Ignore:
Timestamp:
28/09/09 14:16:55 (10 years ago)
Author:
pnorton
Message:

Modified the beaker cache decorator that comes with pylons so that it includes response content written to response.write(). Added this decorator to a number of controllers to try and improve the performacne.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • qesdi/wms_ddc_vis/trunk/lib/wms_ddc_vis/controllers/coastwms.py

    r5762 r5773  
    3232from cows.xml.iso19115_subset import OnlineResource 
    3333 
     34from wms_ddc_vis.lib.modified_beaker_cache_decorator import beaker_cache 
     35 
    3436log = logging.getLogger(__name__) 
    3537 
     
    176178            return dimName 
    177179         
    178      
     180    @beaker_cache(expire=600, query_args=True) 
    179181    def GetMap(self):         
    180182        st = time.time() 
    181  
    182183 
    183184        parser = SlabOptionsParser(CoastwmsController.renderingOptions, request.params) 
     
    218219  
    219220        longResolution = parser.getOption('resolution') 
    220         log.debug("longResolution = %s" % (longResolution,)) 
     221        #log.debug("longResolution = %s" % (longResolution,)) 
    221222        resMap = {'coarse':'c', 
    222223                  'low':'l', 
     
    228229        resolution = resMap[longResolution] 
    229230          
    230         log.debug("resolution = %s" % (resolution,)) 
     231        #log.debug("resolution = %s" % (resolution,)) 
    231232 
    232233        #make the colour compatable with matplotlib 
    233234        if bgcolor.find('0x') == 0: 
    234235            bgcolor = '#' + bgcolor[2:] 
    235         log.debug("bgcolor = %s" % (bgcolor,)) 
     236        #log.debug("bgcolor = %s" % (bgcolor,)) 
    236237        ldg = LayerDrawerCoastlines(transparent=transparent, 
    237238                                    resolution=resolution, 
     
    252253        try: 
    253254            ua = request.headers['User-Agent'] 
    254             log.debug("ua = %s" % (ua,)) 
     255            #log.debug("ua = %s" % (ua,)) 
    255256        except: 
    256257            pass 
     
    266267 
    267268         
    268         log.debug("got coastline in %s" % (time.time() - st,)) 
    269  
     269        #log.debug("got coastline in %s" % (time.time() - st,)) 
     270 
     271    @beaker_cache(expire=600, query_args=True) 
    270272    def GetContext(self): 
    271273        """ 
     
    315317            raise InvalidParameterValue('Format %s not supported' % format) 
    316318 
    317  
     319    @beaker_cache(expire=600, query_args=True) 
    318320    def GetDisplayOptions(self): 
    319321         
Note: See TracChangeset for help on using the changeset viewer.