-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Add footer template file caching #6148
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this will cache that fragment for all users and projects, every response is different for each project/version
https://docs.djangoproject.com/en/2.2/topics/cache/#template-fragment-caching
Yeah, I require input from your end. I suggest:
? |
We use redis for caching in production. |
@davidfischer hi: oh ok, does everything else works w/ you? or you have more ideas? |
@davidfischer: have any thoughts? |
@stsewd's comment still stands, I believe. This would cache the footer for one project across all projects. |
@stsewd, @davidfischer: sure, I require inputs/thoughts for: #6148 (comment). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @tapaswenipathak! Thanks for the contribution here.
I'm not sure what's the problem we are trying to solve. Is the footer rendering causing us any problem? In that case, supposing we want to implement this at template level, we need to be very careful with the variables used as keywords to avoid showing a footer of one project in another one.
This PR probably needs more discussion around the problem and the solution proposed before merging it.
@@ -1,4 +1,6 @@ | |||
<!-- Inserted RTD Footer --> | |||
{% load cache %} | |||
{% cache 900 footer %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will cache the footer and use the same footer for all the projects. That's not correct. We need to add more keywords where.
Also, adding cache here, even if we use the proper variables/keywords, could cause confusions on users when a new version is activated, a translation is added, etc. So, we may want to invalidate the cache in those cases as well.
@humitos hi: You can read the ticket, the footer view should be cached properly. Why are we going back and forth in discussing what the pr does and wasting time
can I please get few notes for #6148 (comment)? |
Hi @tapaswenipathak! This PR can't be merged as it is because it will return the same footer for all the projects on Read the Docs as I explained at #6148 (comment). Also, we did not settle on a proper solution and there should be more discussion around it before continue with an implementation. Unfortunately, the original issue is under "Needed: design decision" and it's not "Approved". I'm closing this PR for now and we can come back later once we have a better idea of how to cache the footer. |
Added caching for footer html file. Writing one PR for memcache implementation.
Fixes - #6126.