Changeset 5768 for cows


Ignore:
Timestamp:
25/09/09 15:26:11 (10 years ago)
Author:
pnorton
Message:

Added the cows.browser_caching_enabled property that will set the returned images of the cows WMS to be cahced for 1hour.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cows/trunk/cows/pylons/wms_controller.py

    r5755 r5768  
    1717from sets import Set 
    1818from matplotlib.cm import get_cmap 
    19 from pylons import request, response, c 
     19from pylons import request, response, c, config 
    2020from routes import url_for 
    2121from routes.util import GenerationException 
     
    584584 
    585585        response.headers['Content-Type'] = format 
     586         
     587        if config.get('cows.browser_caching_enabled','').lower() == 'true': 
     588            response.headers["cache-control"] = "public, max-age=3600" 
     589            response.headers["pragma"] = "" 
     590                     
    586591        response.write(buf.getvalue())     
Note: See TracChangeset for help on using the changeset viewer.