« The Road to Hell Is Paved With Caching | Main | Advanced Performance Optimization of Rails Applications Presentation at RailsConf 2009 »

July 14, 2008

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/services/trackback/6a00d83451c8d369e200e5539c3f438833

Listed below are links to weblogs that reference Why You Should Use 'Cache-Control: public' for Caching to Work with SSL:

Comments

Tom

I don't think it is a bug.

SSL content is assumed to be confidential, and should not be saved to disk. It seems a bit rash to tell people to enable this, without explaining the risks.

And if the in-memory cache is full, something has to be evicted. If you have 50+ tabs open, you could easily have have 1MB of JS per tab. Once the working set is bigger than the available cache, the cache will just thrash and be useless.

Brian

Agreed,
This is not a bug. Caching SSL data to disk is not secure. To avoid caching issues in the 1990's we would use SSL to stop aggressive caching by ISP (dial-up days). If you are have performance issues with your application because of files not caching, I would recommend you re-architect your application.

Alexander Dymo

Tom, Brian, I agree, disk caching of SSL content is not secure and I'm not recommending it, just saying it can be a workaround.

What I did want to say is that Firefox has too small memory cache size and if you don't use "Cache-Control: public" on your side, Firefox may never manage to keep the pages in memory cache for your users.

Users with 5 tabs will never see that, users with 50 tabs will think your web application is slow just because the content that should have been cached (in memory) will never be cached at all. So as an application developer you really have only two choices - ask those users to increase memory cache or put "Cache-Control: public".

Gleb Arshinov

Tom: the article describes (perhaps not clearly enough), that FF appears to use MRU eviction algorithm for this content, which likely is a bug. Meaning, it's evicted immediately, and never cached. We are not talking about the normal LRU cache behavior.

mrbrdo

Actually, I think it IS a bug.

http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.3
"The max-age directive on a response implies that the response is cacheable (i.e., "public") unless some other, more restrictive cache directive is also present."

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment

Buzzletter

  • Hear about our new Ruby on Rails performance improvements, hacks, recipes, plugins & more. Enter your email below