Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix account JSON/RSS not being cacheable due to wrong mime type comparison #13116

Merged
merged 1 commit into from
Feb 19, 2020

Conversation

ClearlyClaire
Copy link
Contributor

request.format is not a symbol but a Mime::Type, so the condition actually
never matched, and a session was created even for those requests, preventing
caching.

`request.format` is not a symbol but a `Mime::Type`, so the condition actually
never matched, and a session was created even for those requests, preventing
caching.
@ClearlyClaire
Copy link
Contributor Author

Note that, the cache being broken results in weird and interesting behaviors when fetching an actor from an instance that had caching previously working: given sufficient requests to get puma busy, with the provided configuration, nginx will serve stale actor data with X-Cached: UPDATING. Since caching is broken, this stale data won't get updated.

Furthermore, we do not expose things like updated_at in the AP actor representation, so we can only assume the fetched version is newer, which in this case is false… see #13117

@Gargron Gargron changed the title Fix actor json/rss caching Fix account JSON/RSS not being cacheable due to wrong mime type comparison Feb 19, 2020
@Gargron Gargron merged commit d8e9bae into mastodon:master Feb 19, 2020
rtucker pushed a commit to vulpineclub/mastodon that referenced this pull request Jan 7, 2021
…rison (mastodon#13116)

`request.format` is not a symbol but a `Mime::Type`, so the condition actually
never matched, and a session was created even for those requests, preventing
caching.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants