Closed emxsys closed 6 years ago
@PJHogan FYI
I'm sure there will eventually need a 'handler' that knows when to update the cache with more recent data. But that is assumed to be rather infrequent and non-critical in this particular instance. But meanwhile, it seems this technique will also speed up performance on the local smart device.
I added the following reverse proxy settings to the apache2.conf
to:
ProxyRequests off
<LocationMatch "/worldwind25/">
ProxyPass https://worldwind25.arc.nasa.gov/
Header set Cache-Control "max-age=290304000, public"
</LocationMatch>
<LocationMatch "/worldwind26/">
ProxyPass https://worldwind26.arc.nasa.gov/
Header set Cache-Control "max-age=290304000, public"
</LocationMatch>
I created and configured several alternative layer and elevation classes that use an emxsys.net WMS URL instead of a worldwind.arc.nasa.gov WMS URL to leverage the Cache-Control headers set by the emxsys.net reverse-proxy.
The BlueMarble, Landsat and elevations can now be loaded from the browser's disk cache for a substantial increase in performance. This technique bodes well for permitting off-line use, however the WMT app itself will need a web-host other than GitHub pages in order to set the app's cache-control headers -- GitHub pages does not allow changes to the setting which default is 1 hour.
See the commit for the list of classes and changes: ee7d87ee2268ac8f513cb5087d0a49225b6d65bb
Create a reverse proxy for the WorldWind WMS servers that adjusts the cache-control headers to allow the browser to use cached content: