This patch explicitly sets the block cache to BLOCK_CACHE_PER_PAGE (if this isn't set, it was defaulting to BLOCK_CACHE_PER_ROLE, which isn't desirable for blocks that are changing per SOPAC record).

CommentFileSizeAuthor
sopac.block_cache.patch1.53 KBjhedstrom

Comments

jhedstrom’s picture

Version: 6.x-2.1-rc1 » 6.x-2.1-rc2
Sid_M’s picture

I actually suspect that in most cases we want to set these blocks to not cache at all, or we need to add a mechanism which clears the cache for sopac catalog-related pages. The problem is that these blocks tend to be put on pages which are created by sopac: e.g. the page for a search result; or for a specific catalog item. At the moment, those pages never clear their cache, and thus the blocks would never be renewed if they are set per page (or rather, would only be renewed when the entire page cache was cleared). This would mean that the blocks would grow increasingly out of date until some other page on the site coincidentally triggered a clearing of the page cache for the site as a whole.

Given that the newest version of sopac has its own internal caching mechanism, and has a setting for when that mechanism should refresh, it probably makes sense to modify sopac so that it clears caching of its pages whenever its own cache would expire. I believe that it currently defaults to one hour. If that were done, then it would make sense for the blocks to be set per page.