SF has always been expensive. When I moved here, my grandfather who was an actuary for an insurance company (i.e. walking financial database) told me that back in the 1930s, they had to pay 2-3x salary for people based there due to the high cost of living. If you read old issues of the SF Chronicle, you'll find the same story repeated across generations.
The only time SF was every really cheap was during the 70s into the late 80s, which was due to a combination of white flight, the Loma Prieta earthquake, and the AIDS plague depopulating the city. Apart from that anomaly, it has been super pricey ever since the Gold Rush.