Skip to content

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

Closed

Conversation

tapaswenipathak
Copy link
Contributor

@tapaswenipathak tapaswenipathak commented Sep 7, 2019

Added caching for footer html file. Writing one PR for memcache implementation.

Fixes - #6126.

Copy link
Member

@stsewd stsewd left a 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

@tapaswenipathak
Copy link
Contributor Author

tapaswenipathak commented Sep 9, 2019

Yeah, I require input from your end. I suggest:

?

@davidfischer
Copy link
Contributor

We use redis for caching in production.

@tapaswenipathak
Copy link
Contributor Author

tapaswenipathak commented Sep 9, 2019

@davidfischer hi: oh ok, does everything else works w/ you? or you have more ideas?

@tapaswenipathak
Copy link
Contributor Author

@davidfischer: have any thoughts?

@davidfischer
Copy link
Contributor

@stsewd's comment still stands, I believe. This would cache the footer for one project across all projects.

@tapaswenipathak
Copy link
Contributor Author

tapaswenipathak commented Oct 16, 2019

@stsewd, @davidfischer: sure, I require inputs/thoughts for: #6148 (comment).

Copy link
Member

@humitos humitos left a 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 %}
Copy link
Member

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.

@tapaswenipathak
Copy link
Contributor Author

tapaswenipathak commented Oct 16, 2019

@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

would cache the footer for one project across all projects

can I please get few notes for #6148 (comment)?

@humitos
Copy link
Member

humitos commented Nov 18, 2019

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.

@humitos humitos closed this Nov 18, 2019
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.

4 participants