Repository navigation
Stop creating a session for every weblog page view - #248
Merged
Merged
Conversation
LoadSaltFilter is mapped to /roller-ui/* and has run on forwards as well as requests since apache#167. Weblog pages, feeds, resources and searches are forwarded to the rendering servlets under /roller-ui/rendering/, so each one now called getSession(true) and put a salt in the cache, for every anonymous visitor and crawler. The rendering servlets output none of Roller's own forms, so the filter now passes those requests straight through.
snoopdave
reviewed
Nov 14, 2026
…e-view # Conflicts: # CHANGES.md
The public comment form has no salt and posts to the entry permalink, which is forwarded to the comment servlet under /roller-ui/rendering. ValidateSaltFilter is mapped to direct requests only, so it never sees that forward; the new SaltConfigurationTest case pins that mapping, because adding FORWARD to it would reject comments from anyone with a session. LoadSaltFilterTest now also covers the forwarded comment POST, which no longer gets a session or a salt.
The journey now comments on the published entry twice through the real form: once as the signed-in author and once from a fresh browser context with no cookies. Both comments must be accepted without a salt. It also checks that reading the weblog front page leaves the visitor without a JSESSIONID cookie, which fails on master and passes with the LoadSaltFilter change.
The comment said the rendering servlets contain none of Roller's forms, which overlooks the comment form. It now says that form submits no salt and is not checked for one.
# Conflicts: # CHANGES.md
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.
While running a 7.0.0 snapshot against a copy of my site, I noticed every weblog page, feed and resource response carried a
Set-Cookie: JSESSIONID. On 5.0.3 none of them did.The cause is
LoadSaltFilter. It's mapped to/roller-ui/*, and since #167 it runs onFORWARDas well asREQUEST. Weblog requests are forwarded to the rendering servlets under/roller-ui/rendering/, so the filter runs for each one, callsgetSession(true)and adds a salt to the cache. On a public site that means a session and a cache entry for every anonymous page view and every crawler request.The rendering servlets don't output any of Roller's own forms, so they have no use for a salt. This change makes the filter pass requests under
/roller-ui/rendering/straight through./roller-ui/login.rolstill does.Comment posting is unaffected. The comment form posts to the entry permalink and is forwarded to the comment servlet, and
ValidateSaltFilterdoes not run on forwards, so comments have never been salt-checked. A commenter still gets a session from the comment authenticator when the form loads. Checked on Jetty before and after for an anonymous visitor and a signed-in user (accepted in all four runs), and now covered byNewUserJourneyITandSaltConfigurationTest.