Skip to content

Include the page number in feed cache keys and limit page numbers - #325

Merged
mraible merged 5 commits into
roller-6.1.xfrom
feed-cache-page-key-6.1.x
Nov 20, 2026
Merged

mraible merged 5 commits into
roller-6.1.xfrom
feed-cache-page-key-6.1.x

Conversation

@mraible

@mraible mraible commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

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 skipCache parameter 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:

  • Next and previous links in search, entry, comment and media file feeds no longer fail with a server error when the feed URL has q, cat, tags or excerpts together with page.
  • The tag data service returns exactly services.tagdata.max tags per page, so a tag no longer appears at the end of one page and again at the start of the next.

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 snoopdave left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 snoopdave left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@mraible
mraible merged commit 62a6d2a into roller-6.1.x Nov 20, 2026
7 checks passed
@mraible
mraible deleted the feed-cache-page-key-6.1.x branch November 20, 2026 00:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants