Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http caching could be improved #289

Open
gugurete opened this issue May 18, 2017 · 7 comments
Open

http caching could be improved #289

gugurete opened this issue May 18, 2017 · 7 comments

Comments

@gugurete
Copy link

tile server used by https://worldview.earthdata.nasa.gov has http caching disabled :

Request URL:https://gibs-b.earthdata.nasa.gov/wmts/epsg4326/best/wmts.cgi?layer=Coastlines&style=default&tilematrixset=250m&Service=WMTS&Request=GetTile&Version=1.0.0&Format=image%2Fpng&TileMatrix=5&TileCol=16&TileRow=3
Request Method:GET
Status Code:200 OK
Remote Address:198.118.199.5:443
Referrer Policy:no-referrer-when-downgrade
Access-Control-Allow-Origin:*
Cache-Control:no-cache, no-store, must-revalidate
Connection:Keep-Alive
Content-Length:1096
Content-Type:image/png
Date:Thu, 18 May 2017 00:08:39 GMT
Expires:Thu, 18 May 2017 00:08:39 GMT
Keep-Alive:timeout=5, max=100
Pragma:no-cache
Server:Apache
Strict-Transport-Security:max-age=31536000
X-Frame-Options:SAMEORIGIN

setting a http header like cache-control:public, max-age=31536000 for static image data as in the case of map tiles will improve performance dramatically

@rboller
Copy link
Member

rboller commented May 18, 2017

Thanks for the suggestion, we've gotten similar requests in the past though it's not entirely trivial in this case. The first hurdle is that map tiles for "today" and "yesterday" get frequently updated and we wouldn't want the browser to show a mish-mash of old and new tiles. The second is that, at least when we looked into it a few years ago, Worldview relies on "fresh" tiles for certain features. We'll plan to take another look to see if that's still the case, though. WV-571 is the internal reference ticket from before our Github days.

@hugh-gibson
Copy link

You could set a short timeout for the cache, say 10 minutes, which would be of some benefit in reducing traffic. The browser will automatically validate the data with the server, getting a 304 response (not modified) if the file has not changed. This requires a server round-trip but doesn't send the data again.

For more information see https://devcenter.heroku.com/articles/increasing-application-performance-with-http-cache-headers . The timeout would be 600.

@minniewong
Copy link
Contributor

This is being addressed by GIBS: GIBS-37

@minniewong
Copy link
Contributor

minniewong commented May 29, 2018

This is now being addressed by ONEARTH: ONEARTH-513

@minniewong
Copy link
Contributor

Now being addressed in: GITC-992

@minniewong
Copy link
Contributor

@mcechini Will this be addressed in GIBS?

@mcechini
Copy link
Collaborator

mcechini commented Feb 4, 2020

Yes, but not until OnEarth 2.x is servicing request... so still another year away. But I would like to see smarter caching someday

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Worldview
  
External Dependency
Development

No branches or pull requests

5 participants