[ckan-dev] Caching - package pages (development copy)

William Waites ww at eris.okfn.org
Thu Dec 2 15:57:22 UTC 2010


* [2010-12-02 14:44:02 +0000] Richard Pope <richard at memespring.co.uk> écrit:

] I'm hitting a caching problem on the package page. All my settings are
] set to zero:

So this is becoming a FAQ - the answer is in the list archives, but
I'll repeat.

] 
] # CKAN search cache
] # any non-empty value enables it
] enable_caching =

What you want is

     cache_enabled = no

this is the configuration setting that is used by beaker and the
beaker-derived ckan.lib.cache. The "enable_caching" setting is a
historical ckan thing that has something to do with template caching.
enable_caching should be deprecated and merged with cache_enabled (and
also be made to work with asbool() instead of this "set to any value
even if a confusing one like no or false to enable" business.

] # cache to persistent files
] beaker.cache.type = file
] # cache expiry settings for specific controllers
] # by default these are disabled, enable as needed to a time in seconds
] ckan.controllers.home.expires = 0

this value means that etags (based on the last modified time) are used
instead of telling upstream caches (i.e. squid or your web browser) to
cache pages for a certain time. the pages will still get cached
internally unless they have been modified. If you suspect an actual
bug, sprinkle some printfs in ckan.lib.cache and
controller.package.last_modified

] ... but the pages are still being cached so changes I make are not
] visible.  Any suggestions? def etag_cache(cache_key) on approx. line
] 108 is as far as the code runs.

changes you make should be sufficient to trigger an update to the
last_modified value which should cause the internal (beaker) cache to
be refreshed.

HTH,
-w
-- 
William Waites
http://eris.okfn.org/ww/foaf#i
9C7E F636 52F6 1004 E40A  E565 98E3 BBF3 8320 7664




More information about the ckan-dev mailing list