MapStory / mapstory-meta

MapStory
http://mapstory.org
32 stars 16 forks source link

Deploy new time slider playback code to production #465

Closed cholmes closed 11 years ago

cholmes commented 11 years ago

We need to get the nice caching stuff that's on mapstory dev rolled out, so stories play much better.

Can take time with this, to try to fully learn the codebase, so it's easier to improve. Feel free to use Ivan to help on this if needed.

bartvde commented 11 years ago

This is now on dev, ready for testing.

cholmes commented 11 years ago

So this appears to be working great on layers with smaller number of time series, like http://mapstory.dev.opengeo.org/maps/223 I assume this is all the openlayers new caching code working. Once you play through the layer once then it doesn't ask for any additional server requests, just plays along beautifully.

If you do one with more time series though it continues to ask for more tiles after one play through. See http://mapstory.dev.opengeo.org/maps/147 or http://mapstory.dev.opengeo.org/data/geonode:Post_Offices0 I assume this is because the first tiles are getting expelled from the cache. But there was a bit of time on dev where we had GWC working proper with cache control headers. So that on the second play through it wouldn't be the dom cache, but would be the browser cache.

Hrm, actually post offices works on firefox with no further requests, though the first one, the earthquake map, doesn't on firefox. Both start asking for more requests on chrome. So I assume firefox has a bigger browser cache?

Anyways, I'd assume that on second play through of those they'd be getting 304 not modifieds from the server. That's how things were working before the openlayers caching code.

bartvde commented 11 years ago

FYI the DOM cache size is set to 512 images currently.

cholmes commented 11 years ago

Hrm, this may be more for @ischneider

Digging in to it indicates to me that GWC isn't caching at all, it's getting misses.

See for example http://mapstory.dev.opengeo.org/geoserver/geonode/Post_Offices0/wms?SERVICE=WMS&LAYERS=Post_Offices0&FORMAT=image%2Fpng&TRANSPARENT=TRUE&VERSION=1.1.1&REQUEST=GetMap&STYLES=&TILED=true&SRS=EPSG%3A900913&TIME=1639%2F1999&BBOX=-20037508.34,0,-10018754.17,10018754.17&WIDTH=256&HEIGHT=256

I get headers of:

Date: Thu, 31 Jan 2013 15:27:00 GMT Server: Apache-Coyote/1.1 geowebcache-miss-reason: no parameter filter exists for TIME geowebcache-cache-result: MISS Content-Disposition: inline; filename=geonode-Post_Offices0.png Content-Type: image/png Via: 1.1 mapstory.dev.opengeo.org Keep-Alive: timeout=15, max=72 Connection: Keep-Alive Transfer-Encoding: chunked

200 OK

Or on http://mapstory.dev.opengeo.org/geoserver/wms?LAYERS=geonode%3AEQ_and_TS&FORMAT=image%2Fpng&TRANSPARENT=TRUE&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=EQ_and_TS_bbb43e71&TILED=true&SRS=EPSG%3A900913&TIME=1949-01-01T00%3A00%3A00.000Z&BBOX=0,0,10018754.17,10018754.17&WIDTH=256&HEIGHT=256

I get

geowebcache-miss-reason: not a tile layer geowebcache-cache-result: MISS

Ian, was there some change that made it so GWC isn't caching the time layers? Also is the max-age stuff on there? It'd be nice to play some with that, especially on the viewer. Have the browser not even have to ask the server if things changed.

cholmes commented 11 years ago

That makes a lot of sense, that's about the number where requests start being asked again. I think we should keep it the same, and tap in to the next level of caching for things bigger than that, using the browser cache.

ischneider commented 11 years ago

thanks for checking all this out @cholmes

regarding the 'not a tile layer' issue: new layers will be configured using the REST API. Old layers have to be 'updated' still. Some layers have been manually configured. I do need to create/ensure the migration code works well and run it so we're not spending time wondering why it's not activated. Apologies for any confusion.

I configured the EQ_and_TS layer and added an expires rule. I'm not seeing the max-age headers either so I'll have to look into that. The hacky patch may have not been deployed or it may have been overwritten.

The client-based caching stuff seems to be working pretty nice :8ball:

cholmes commented 11 years ago

This is all deployed to production now, with a bit of a hiccup with gwc on amazon opening random ports.