Reduce server load caused by anonymous viewing.#9059
Merged
Gargron merged 1 commit intomastodon:masterfrom Mar 17, 2019
Merged
Conversation
303fe53 to
d5db9d3
Compare
Member
|
@nightpool Is this safe? |
Member
|
I don't understand why we're coupling it to skip_session, that feels like
overloading the helper too much.
I'll have to think about safety a little bit more. at the very least, we
should make sure to add the logged in status to whatever cache key we're
sending.
…On Mon, Oct 22, 2018, 8:05 PM Eugen Rochko ***@***.***> wrote:
@nightpool <https://github.com/nightpool> Is this safe?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#9059 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAORVyto9Us_jfEIdU3tDshOGJo7D9mgks5unl1ZgaJpZM4X0ZW9>
.
|
Contributor
Author
|
This code is live on https://mastodon.lubar.me/ if you want to play around with it. It shouldn't be sending any cookies or showing anything that requires logging in on pages where |
d5db9d3 to
303fe53
Compare
Contributor
|
The added The reason for this is that sessions aren't the only way to access private info, and tying the |
Gargron
requested changes
Mar 15, 2019
Do not start a session if the current user is not logged in for public-facing pages. Mark pages that don't care about sessions as publicly cacheable. Keep the max age as 0 so proxies and browsers will still try to retrieve an updated version but can still fall back to the stale version if the site is down or too slow. Fixes mastodon#9035.
ClearlyClaire
approved these changes
Mar 17, 2019
Gargron
approved these changes
Mar 17, 2019
hiyuki2578
pushed a commit
to ProjectMyosotis/mastodon
that referenced
this pull request
Oct 2, 2019
Do not start a session if the current user is not logged in for public-facing pages. Mark pages that don't care about sessions as publicly cacheable. Keep the max age as 0 so proxies and browsers will still try to retrieve an updated version but can still fall back to the stale version if the site is down or too slow. Fixes mastodon#9035.
messenjahofchrist
pushed a commit
to Origin-Creative/mastodon
that referenced
this pull request
Jul 30, 2021
Do not start a session if the current user is not logged in for public-facing pages. Mark pages that don't care about sessions as publicly cacheable. Keep the max age as 0 so proxies and browsers will still try to retrieve an updated version but can still fall back to the stale version if the site is down or too slow. Fixes mastodon#9035.
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.
Do not start a session if the current user is not logged in for public-facing pages.
Mark pages that don't care about sessions as publicly cacheable.
Keep the max age as 0 so proxies and browsers will still try to retrieve an updated version but can still fall back to the stale version if the site is down or too slow.
Fixes #9035.