Changeset 6d98a8 in indico


Ignore:
Timestamp:
03/04/10 15:54:36 (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, d9941f8582b36b24821a11ea5ba16fda6a457fb1
Children:
cbf11a
Parents:
bf522c
Message:

[FIX] Caching policy for IE

  • added exception for MSIE browsers;
  • IE doesn't seem to like the "no-cache" directive;
  • fixes #272
File:
1 edited

Legend:

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

    r1bba09 r6d98a8  
    2828what to do depending on the parameter values received, etc. 
    2929""" 
    30 import copy, time, os, sys, random 
     30import copy, time, os, sys, random, re 
    3131import StringIO 
    3232from datetime import datetime, timedelta 
     
    238238 
    239239        self._req.headers_out["Pragma"] = "no-cache" 
    240         self._req.headers_out["Cache-Control"] = "no-store, no-cache, must-revalidate" 
     240 
     241        # IE doesn't seem to like 'no-cache' Cache-Control headers... 
     242        if (re.match(r'.*MSIE.*', self._req.headers_in["User-Agent"])): 
     243            self._req.headers_out["Cache-Control"] = "private" 
     244            self._req.headers_out["Expires"] = "-1" 
     245        else: 
     246            self._req.headers_out["Cache-Control"] = "no-store, no-cache, must-revalidate" 
    241247 
    242248 
Note: See TracChangeset for help on using the changeset viewer.