Skip to content

Cache the footer_api template based on version for one minute #4524

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
wants to merge 3 commits into from
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions readthedocs/restapi/templates/restapi/footer.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
{% load cache %}

{# Vary the cache on the version #}
{% cache 60 footer-html version.pk %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about adding versions.count as a key also here and increasing the time of the cache a little more?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually realized this isn't specific to the version, but to the project as a whole, so that should be even better.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The VCS block actually will change by page, so I need to think through this a bit more.


<!-- Inserted RTD Footer -->
<div class="injected">

Expand Down Expand Up @@ -136,3 +141,5 @@
{% endif %}

</div>

{% endcache %}