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

Increase Cache Hit Performance #566

Open
jmarsh24 opened this issue Jan 14, 2025 · 1 comment · May be fixed by #571
Open

Increase Cache Hit Performance #566

jmarsh24 opened this issue Jan 14, 2025 · 1 comment · May be fixed by #571

Comments

@jmarsh24
Copy link
Contributor

In the talk show view, the current user is being used in the cache key. I believe this is only used for caching whether a talk is cached or not. This increases the stored cache significantly as a _talk has to be cached for every user who views it. Instead it should use a boolean value to indicate if the talk is watched or not in order for the partial to be cached and shared amongst users.

<% cache_key = [@talk, Current.user, @talk.watched_talks.where(user: Current.user)] %>

@adrienpoly
Copy link
Owner

I agree this cache key should be simplified. This being said I think most of the visitors are unauthenticated so they all end up in the same cache key.

Probably we could remove this part from the cache key @talk.watched_talks.where(user: Current.user) if we wheere to add a touch: true to the watched_talk user association

@adrienpoly adrienpoly linked a pull request Jan 15, 2025 that will close this issue
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 a pull request may close this issue.

2 participants