HTTP headers are sent with the tile image to control
the caching of tiles on the client side.
There are two ways of specifying expiry data for tiles
on the client side.
-
public long getExpirationDate(HttpServletRequest request)
This method returns the expiry date in milliseconds of
tile lifespan in the client-side cache.
Override the protected method:
void setImageResponseCachePolicy(HttpServletRequest request,
HttpServletResponse response);
This method sends the HTTP headers to the client, so
that the server instructs the client how to cache the tiles.
See RFC 2616 on HTTP/1.1 for a full description of HTTP
headers.
You need to take the following cases into account:
The normal image request: you should
prevent caching in this case.
The tile image request, which is identified
by the tile
request parameter: this type
of request can be cached on the client.