Caching guide?


I’ve got a site entirely over https. I would like to be able to enable caching. Is there a good guide you can refer me to for this?


Caching + https doesn’t make a lot of sense. If you are securing all of your traffic then chances are it is dynamic and contains user specific data. You cannot effectively cache this using normal CDNs or tools like Varnish. You could probably implement a memory level caching system like memcached but beyond that I’m not sure how much of your site you are going to be able to cache.

A few more details would help with any further assessment.

Our website is fairly dynamic, but we have some images and javascript files which don’t change very often, and when they do change the file name changes with it.

I was looking at this post when I was thinking of caching for https:

I’m not very familiar with web optimization yet, so thanks for any help!

Ah, I thought you were talking about page level caching. You can still cache static content like JS/CSS/images without any problems. There are a couple things you may want to do - number one would be adding cache control headers like that post describes. That will allow your users to cache the content in their browser. Depending on your traffic you may also want to look into a CDN solution like MaxCDN to distribute your content and take some load off of your servers. Hope this helps.

The only tweak you have to do that is specific to https (that I’m aware of) is to set “cache-control: public” in the headers, otherwise IE will not cache static objects over https. The rest should work just like normal http requests with standard Expires settings.