OpenLayers OpenLayers

Ticket #317 in OpenLayers is 'Customization for Static and Dynamic Layer'. The ticket describes a desire for functionality allowing one to avoid the browser cache for images.

This caching is not done at the OpenLayers level: instead, it is done at the browser level. However, it is possible to avoid the caching at the browser level using OpenLayers code as it stands.

When creating a layer which is a subclass of an HTTPRequest layer, it is possible to specify a hash of parameters which are used to construct the URL. This list is not validated before being used: it is used to construct the URL for the request directly. This means that you can specify, for example, a 'version' parameter.

When you want to expire the current cache, just update the 'version' parameter: this can be done using 'layer.mergeNewParams({'version':2});', which will update the tiles to not use the cached tiles.