WorldWindEarth / wildfire

The Wildfire Management Tool - WMT (v2.0) - a geo-browser that provides weather and fire behavior forecasts to ensure the safefy of firefighters and effective use of resources
https://worldwind.earth/wildfire
MIT License
15 stars 3 forks source link

Create reverse proxy server for WorldWind services #28

Closed emxsys closed 5 years ago

emxsys commented 5 years ago

Create a reverse proxy for the WorldWind WMS servers that adjusts the cache-control headers to allow the browser to use cached content:

emxsys commented 5 years ago

@PJHogan FYI

PJHogan commented 5 years ago

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.

emxsys commented 5 years ago

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>
emxsys commented 5 years ago

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