Repository navigation
Include the page number in feed cache keys and limit page numbers - #313
Merged
Merged
Conversation
Feed requests for later pages of entries now get their own keys in the weblog feed cache and the site-wide cache, so each page is cached separately. The page number is added only after the first page, so existing keys stay the same. The page request parameter for feeds and weblog pages is now kept between 0 and 10000 when parsed, so the pager offset computed from it stays within range. The page servlet now skips the page cache only when the server sets the skipCache request attribute, as it does for forwarded comment posts, and no longer reads a skipCache query parameter.
This was referenced Nov 18, 2026
snoopdave
reviewed
Nov 18, 2026
snoopdave
left a comment
Contributor
There was a problem hiding this comment.
Review of 2be6137de: The twin PR has the same fix hunks, apart from the expected javax/jakarta imports. The main paths have regression tests, but the cache key format and two other page parsers still need changes.
WeblogFeedCache and SiteWideCache now URL-encode the search term and each tag name in feed keys, as they already do for the category name, so a "/" in a term or tag can't make it look like the page number or another key part. WeblogFeedCacheKeyTest checks that terms and tags such as "foo/page=2", "foo/excerpts" and "a+b" get keys of their own.
…e limit WeblogSearchRequest now reads the page parameter with the same parser as weblog pages and feeds, so it stays between 0 and 10000. TagDataServlet returns 400 for page numbers below 0 or above 10000, as it already does for page numbers that aren't numbers. Pagers, the feed history links and the tag data XML no longer offer a Next link on page 10000, since a request for the following page would be read as page 10000 again.
WeblogPageRequest no longer passes a skipCache query parameter on to templates as a custom parameter. The page servlet no longer reads that parameter, and custom parameters are part of the page cache key, so each skipCache value would otherwise get its own cache entry. PageParameterTest checks that skipCache is dropped and other custom parameters are kept.
Contributor
Author
|
A second review raised a few more points, now addressed in the latest commits:
|
The next and previous links of the search, entries, comments and media file feed pagers threw UnsupportedOperationException whenever the feed request had a search term, category, tags or excerpts, because AbstractPager handed createURL an immutable map that those pagers add their parameters to. It now passes a mutable map. TagDataServlet fetches one tag more than a page holds to find out whether there is a next page, and it printed that extra tag too, so every full page had one tag too many and that tag showed up again at the top of the next page. Both the JSON and XML output now stop at the page size.
snoopdave
reviewed
Nov 20, 2026
snoopdave
left a comment
Contributor
There was a problem hiding this comment.
Review of e4d3d16aa: The current diff addresses the earlier review points. The production fix hunks match #325 after accounting for branch differences; the tag data tests use different JSON assertions. No new code defect was verified.
Earlier comments: 3 of 3 resolved.
No new issues found.
snoopdave
approved these changes
Nov 20, 2026
mraible
added a commit
to mraible/roller
that referenced
this pull request
Nov 20, 2026
Adds bug-fix and behaviour-change entries for apache#313 to apache#319 and apache#321 to apache#323.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
?page=N) now get their own keys in the weblog feed cache and the site-wide cache, the way the page cache already does. The page number is added only after the first page, so existing keys don't change. The search term and each tag name in a feed key are now URL-encoded, as the category name already was, so a/in a term or tag can't look like the page number or another part of the key.pageparameter of feed, page and search requests is kept between 0 and 10,000 when parsed (WeblogRequest.parsePageNum), so the pager offset computed from it stays in range. A missing or unparsable value means the first page. The tag data servlet answers 400 for page numbers below 0 or above 10,000, as it already did for ones that aren't numbers.PageServletnow skips the page cache only when the server sets theskipCacherequest attribute, as it does for forwarded comment posts. It no longer reads askipCachequery parameter, which nothing in Roller's templates, JSPs or docs uses, andWeblogPageRequestno longer passes that parameter on to templates as a custom parameter, so it doesn't add entries to the page cache either.Tests:
WeblogFeedCacheKeyTest(including terms and tags such asfoo/page=2,foo/excerptsanda+b),PageParameterTest,PageServletCacheTest,PagerNextLinkLimitTestandTagDataServletPageTest.mvn testpasses.CHANGES entries for this and the related fixes will come in one PR, so these don't conflict with each other.
A further review pass added these fixes:
q,cat,tagsorexcerptstogether withpage.services.tagdata.maxtags per page, so a tag no longer appears at the end of one page and again at the start of the next.