Ticket #840 (closed enhancement: fixed)

Opened 3 years ago

Last modified 3 years ago

On/off switch for ETags cache

Reported by: dread Owned by: dread
Priority: major Milestone: ckan-v1.4-sprint-6
Component: ckan Keywords:
Cc: Repository: ckan
Theme: none

Description

  • Use config variable to switch ETags caching on or off. Consider joining in with 'cache_enabled'.
  • Default setting for (all) caching should be off.
  • Needs documenting in configuration.rst

Change History

comment:1 Changed 3 years ago by dread

dread:

] That's the proxy_cache decorator which sets a Beaker expiry time only. ] Whether that is on or off, you still end up run the ] "etag_cache(cache_key)" command in the package controller won't you? ] And won't that will either insert the Etags header or abort 304 for a ] repeat? I must admit I've not tried it, asking purely with the code in ] front of me and welcome you pointing out where I've gone wrong.

ww:

Right. So those etag calls predate the cache decorators and should probably be either moved up into the decorator (e.g. use @ckan_cache instead of @proxy_cache) or wrapped in a check for the config parameter. (And @ckan_cache could be changed to use pylons' etag_cache function rather than just setting the header...)

comment:2 Changed 3 years ago by dread

  • Owner changed from pudo to ww

comment:3 Changed 3 years ago by thejimmyg

  • Owner changed from ww to wwaites

comment:4 Changed 3 years ago by dread

  • Owner changed from wwaites to dread
  • Repository set to ckan
  • Theme set to none

comment:5 Changed 3 years ago by dread

  • Status changed from new to closed
  • Resolution set to fixed

Basic on/off switch added, tested & documented in cset:0da189c9630e on default.

comment:6 Changed 3 years ago by dread

  • Milestone set to ckan-v1.4-sprint-6
Note: See TracTickets for help on using tickets.