Bug 29190 - Additional contents: Cache selected records
Summary: Additional contents: Cache selected records
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Bugs List
QA Contact: Testopia
Depends on: 29144 31385
  Show dependency treegraph
Reported: 2021-10-07 09:03 UTC by Marcel de Rooy
Modified: 2022-08-18 13:06 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Note You need to log in before you can comment on or make changes to this bug.
Description Marcel de Rooy 2021-10-07 09:03:34 UTC
In short:

It would be handy if you could refer to a news page (additional contents) by title (combined with language) instead of only an identifier.

And wouldnt it be nice to cache these pages that are (probably frequently) accessed via opac-main?
Comment 1 Marcel de Rooy 2021-10-07 11:13:35 UTC
Title or code ?
Comment 2 Jonathan Druart 2021-10-07 11:39:07 UTC
Yes, that should be 'code' and 'lang'.
Comment 3 Marcel de Rooy 2022-08-18 11:42:40 UTC
In the meantime 15326 was pushed with CMS pages via additional content.
And we use code to look for CMS pages under 31385.

What remains here, is caching selected pages.
Comment 4 Marcel de Rooy 2022-08-18 13:06:34 UTC
What I could do, is:
Add some get_from_cache and set_in_cache stuff around the code in AdditionalContents.pm for search, search_for_display, find_best_match.

But it would not be very generic in that part of code. And at the same time it is quite tricky to cache searches if they are specific enough. Especially the part of clearing the cache again when some new records are added seems not trivial. So a bit dangerous?