Commits

Andriy Kornatskyy  committed c3da7f1

Added example for cache profile with separated browser cache time and etag use.

  • Participants
  • Parent commits 8679a26

Comments (0)

Files changed (2)

File demos/template/development.ini

 unhandled = stderr
 
 [cache-profile]
+membership-enabled = True
 public-enabled = True
 static-enabled = True
 

File demos/template/src/public/web/profile.py

     http_vary=['Cookie'],
     etag_func=etag_md5crc32,
     enabled=config.getboolean('cache-profile', 'public-enabled'))
+membership_cache_profile = CacheProfile(
+    'both',
+    duration=timedelta(minutes=10),
+    # this cause browser to send request each time
+    # so the server is able to respond with code 304
+    http_max_age=0,
+    vary_environ=['HTTP_ACCEPT_ENCODING'],
+    vary_cookies=['_a'],
+    http_vary=['Cookie'],
+    etag_func=etag_md5crc32,
+    enabled=config.getboolean('cache-profile', 'membership-enabled'))