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

July 14, 2008

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."

Roger

What real world situation would occur where someone would have 50 tabs open - you can only see 15 or 20 tabs in the browser? You have too much time on your hands if you're worrying about the .00000001% of visitors who have 50 tabs open.

The comments to this entry are closed.

Buzzletter

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