Repository navigation
Include the page number in feed cache keys and limit page numbers - #325
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.
snoopdave
reviewed
Nov 18, 2026
snoopdave
left a comment
Contributor
There was a problem hiding this comment.
Review of 79cb3d0c5: The twin PR has the same functional hunks; this branch uses the expected javax imports. The new feed key suffix can collide with existing key components, and page limits remain incomplete at other call sites and at the limit boundary. Review was read-only; no build was run.
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.
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 d6cd5cf3e: The current code addresses all four earlier review points. The production changes match #313; the only twin difference is that #325 checks the tag-data JSON as text, while #313 parses it with Jackson. No new issue was verified. This was a read-only review; no build was run.
Earlier comments: 4 of 4 resolved.
No new issues found.
snoopdave
approved these changes
Nov 20, 2026
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.
The 6.1.x version of #313. The main code cherry-picked cleanly; the new tests use javax.servlet.
It includes #313's later changes: encoded search terms and tag names in feed keys, page limits for search and tag data, Next links that stop at the limit, and no
skipCacheparameter in page cache keys.Tests: PageServletCacheTest, PageParameterTest, WeblogFeedCacheKeyTest, PagerNextLinkLimitTest and TagDataServletPageTest; 4 of the original 7 cases fail without the change. mvn test passes.
CHANGES entries for the 6.1.8 fixes will come in one PR.
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.