[OpenLayers-Dev] Caching layerimages by browsers

Claude Philipona claude.philipona at camptocamp.com
Sat Mar 6 16:38:50 EST 2010


> So, you can improve the caching situation by having your server (or
> gateway cache) use appropriate headers on responses.

In a deep analysis of OL cache browser use in firefox using the
firefox extension "Page Seed", we found out that Firefox is actually
not always using properly the cache browser with OL preseeded tile
system, even though the headers are properly set on the http server.

The Firefox disk cache hash functions can generate collisions for URLs
that differ only slightly, which is the case with preesed tiles image
in OL. Example of url in OL:

http://server.test.org/myappli/mylayer/14/000/000/002/000/000/000.jpeg
http://server.test.org/myappli/mylayer/15/000/000/002/000/000/000.jpeg

Due to a URL conflict, the Firefox browser cache can store only one of
these resources at a time. Changing the URLs of some resources can fix
this problem. Consult the Page Speed documentation for information on
how to disambiguate these URLs.

We found out that we are facing this kind of FF limitation with OL
preseeded layers served thru varnish or Squid

More info from:

http://code.google.com/speed/page-speed/docs/caching.html#LeverageBrowserCaching

Avoid URLs that cause cache collisions in Firefox.

   The Firefox disk cache hash functions can generate collisions for
URLs that differ only slightly, namely only on 8-character boundaries.
When resources hash to the same key, only one of the resources is
persisted to disk cache; the remaining resources with the same key have
to be re-fetched across browser restarts. Thus, if you are using
fingerprinting or are otherwise programmatically generating file URLs,
to maximize cache hit rate, avoid the Firefox hash collision issue by
ensuring that your application generates URLs that differ on more than
8-character boundaries.

Claude



More information about the Dev mailing list