Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

the question is very simple. i want to use the OpenLayers.Control.CacheRead control to load and store tiles when the connection is fast e.g. with wifi network. then use the same device in other places where there is slow or no connection e.g. gprs network.

the examples i have found are not clear on implementation?

For my mobile application, i would like to locally cache the tiles. This i think can be done by CacheRead,

my question is do i need to use CacheWrite to use CacheRead Control or it will be handled by the browser's cache?

and in case i use cachewrite, how can i clear the cache so that new changes in server are visible?

i am trying to cache OpenStreetMap tiles.

share|improve this question
up vote 0 down vote accepted

So I have been doing a brief reading on your question, and here is what I have found:

  1. Yes you need to use both CacheRead & CacheWrite. Your browser will not automatically put the tiles in the Cache, unless you use CacheRead.

    Please have a look at this sample: Offline Storage Example

  2. When your tiles are updated, you can invalidate the cache by using CacheWrite.clearCache()

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.