Changeset de063b in indico


Ignore:
Timestamp:
02/10/10 15:45:19 (3 years ago)
Author:
Pedro Ferreira <jose.pedro.ferreira@…>
Branches:
master, burotel, hello-world-walkthrough, ipv6, new-webex, prov-dual-interface, v0.97-series, v0.98-series, v0.98.2, v0.98.3, v0.98b1, v0.98b2, v0.99, 051b2622c51afb171a1dedb46a0df4fbb0cbd02e, 0da0c1403bae8e51d8229f460181c71b9e6dda72
Children:
39625d
Parents:
893942
Message:

[FIX] Added no-cache headers for files

  • Compensates for previous addition of Last-Modified;
  • Fixes #161;
Location:
indico
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • indico/MaKaC/webinterface/rh/base.py

    rba2d45 rde063b  
    232232        return self._req.headers_in 
    233233 
     234    def _disableCaching(self): 
     235        """ 
     236        Disables caching, i.e. for materials 
     237        """ 
     238 
     239        self._req.headers_out["Pragma"] = "no-cache" 
     240        self._req.headers_out["Cache-Control"] = "no-store, no-cache, must-revalidate" 
     241 
     242 
    234243    def _redirect( self, targetURL, noCache=False ): 
    235244        """Utility for redirecting the client web browser to the specified 
     
    243252                raise MaKaCError(_("http header CRLF injection detected")) 
    244253        self._req.headers_out["Location"] = str(targetURL) 
    245          
     254 
    246255        if noCache: 
    247             # Http 1.1 
    248             self._req.headers_out["Cache-Control"] = "no-store, no-cache, must-revalidate" 
    249             # Http 1.0 
    250             self._req.headers_out["Pragma"] = "no-cache" 
    251          
     256            self._disableCaching() 
    252257        try: 
    253258            self._req.status = apache.HTTP_MOVED_PERMANENTLY 
    254259        except NameError: 
    255260            pass 
    256      
     261 
    257262    def _checkHttpsRedirect(self): 
    258263        if self._tohttps and not self._req.is_https(): 
     
    752757            # let Private OAI harvesters access protected (display) pages 
    753758            return 
    754          
     759 
    755760        if not self._target.canAccess( self.getAW() ): 
    756761            from MaKaC.conference import Link, LocalFile, Category 
  • indico/MaKaC/webinterface/rh/fileAccess.py

    r58010b rde063b  
    4444     
    4545    def _process( self ): 
     46 
     47        self._disableCaching() 
     48 
    4649        if self._file.getId() != "minutes": 
    4750            #self._req.headers_out["Accept-Ranges"] = "bytes" 
  • indico/MaKaC/webinterface/rh/materialDisplay.py

    r81d36db rde063b  
    5555     
    5656    def _process( self ): 
     57 
     58        # material pages should not be cached, since protection can change 
     59        self._disableCaching() 
     60 
    5761        if len(self._material.getResourceList()) == 1: 
    5862            res = self._material.getResourceList()[0] 
     
    6468                elif url.find(".flv") != -1 or url.find(".f4v") != -1 or url.find("rtmp://") != -1: 
    6569                    urlflash = urlHandlers.UHVideoFlashAccess().getURL(res) 
    66                     self._redirect( urlflash) 
     70                    self._redirect( urlflash, noCache=True) 
    6771                else: 
    68                     self._redirect( res.getURL() ) 
     72                    self._redirect( res.getURL(), noCache=True ) 
    6973            elif isinstance(res, conference.LocalFile): 
    70                 self._redirect( urlHandlers.UHFileAccess.getURL( res ) ) 
     74                self._redirect( urlHandlers.UHFileAccess.getURL( res ), noCache=True ) 
    7175        else: 
    7276            #raise "%s"%self._material.getOwner() 
  • indico/htdocs/js/indico/MaterialEditor/Editor.js

    rcbf814 rde063b  
    1 var debugVar, debugVar2; 
    21 
    32type("AddMaterialDialog", ["ExclusivePopup"], { 
     
    784783                         material); 
    785784 
    786                 debugVar = self; 
    787                 debugVar2 = material; 
     785 
    788786            } 
    789787        }); 
Note: See TracChangeset for help on using the changeset viewer.