[OpenLayers-Users] Re: 'Pragma: no-cache' in OpenLayers WMS getMap request

Jan Henrik Øverland janhenrik.overland at gmail.com
Thu Nov 24 11:52:13 EST 2011


Hi, thanks for answering. It's actually the other way around. I do want to
cache, but the guys at columbia.edu says that they can se 'Pragma:
no-cache' in the getMap WMS requests sent from my application and that I
should remove it in order to speed up the loading of their maps.

Jan

>> My WMS layers are created like this:

On Thu, Nov 24, 2011 at 17:24, Diego Guidi <diegoguidi at gmail.com> wrote:

> I'm not sure to understand your problem, but if you need to avoid
> client caching of your requests you can easily manage this stuff using
> redraw(true)
>
> http://dev.openlayers.org/docs/files/OpenLayers/Layer/HTTPRequest-js.html#OpenLayers.Layer.HTTPRequest.redraw
>
> as an alternative you can modify the url adding a random string at the
> end, somethung like wmsurl&123456.
> you can easily manage this task with mergeNewParams
>
> http://dev.openlayers.org/docs/files/OpenLayers/Layer/HTTPRequest-js.html#OpenLayers.Layer.HTTPRequest.mergeNewParams
>
> actually redraw(true) uses mergeNewParams to do it's stuff.
>
> so, you can add a listener to layer.loadstart event and call redraw(true).
>
>
> Diego Guidi
>
>
>
>
> On Thu, Nov 24, 2011 at 5:10 PM, Jan Henrik Øverland
> <janhenrik.overland at gmail.com> wrote:
> > And I don't have any meta tags like
> > <META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
> > <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
> > in my HTML.
> > Jan
> >
> > On Wed, Nov 23, 2011 at 14:02, Jan Henrik Øverland
> > <janhenrik.overland at gmail.com> wrote:
> >>
> >> Hi,
> >> I have WMS overlays (source http://iridl.ldeo.columbia.edu) in my GIS
> >> application (built on ExtJS, Mapfish, OpenLayers). It works, but the
> >> overlays do not seem to show up any faster after the first load and the
> >> Chrome inspector confirms that. So I talked to the guys at columbia.eduand
> >> they say that they can se 'Pragma: no-cache' in my getMap requests.
> >> My WMS layers are created like this:
> >> new OpenLayers.Layer.WMS(
> >>     <name>,
> >>     <url>,
> >>     {
> >>         layers: <layers>,
> >>         transparent: true,
> >>         format: 'image/png'
> >>     },
> >>     {
> >>         isBaseLayer: false,
> >>         buffer: 0,
> >>         ratio: 1,
> >>         singleTile: true
> >>     }
> >> )
> >> How can I control the Pragma parameter? It is obviously not provided in
> >> the base url.
> >> Jan
> >
> >
> > _______________________________________________
> > Users mailing list
> > Users at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/openlayers-users
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20111124/a2f347d5/attachment.html


More information about the Users mailing list