Client-side caching

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.
  • Override the following method of IlvManagerServletSupport:
    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:
  1. The normal image request: you should prevent caching in this case.
  2. The tile image request, which is identified by the tile request parameter: this type of request can be cached on the client.