-
Notifications
You must be signed in to change notification settings - Fork 39
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
Cache public site pages and Apply homepage #1160
Conversation
|
||
{% block table.tbody.row %} | ||
{% cache 3600 submission_table_row row.record.pk row.record.status row.record.last_update %} |
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.
What do you think of this solution?
This will cache each table row that contains a single submission. Need to test to get the correct cache tag but this is a good start I believe.
Would like to use ADV_CACHE_TIMEOUT here instead of hardcoded "3600". Can you help with that? Tried using context but did not get it to work.
94553af
to
3df9287
Compare
3df9287
to
afaa539
Compare
@Parbhat I removed the Advanced cache template tag parts. Should be in another pr and when I started testing the performance impact was small. |
@frjo The solution for caching table using cache template tag looks good. There are some UI issues in some pages like dashboard start showing checkboxes at the start of the row. These issues can be fixed. We can also use the normal cache template tag instead of advanced |
Cache for the public site and apply homepage can be invalidated from
settings > cache
in Wagtail admin. The cache will also be invalidated automatically when a wagtail page is edited/created. The cache will not work for logged in users. And WAGTAIL_CACHE should be setTrue
in local.py settings while testing locally.Also, remove the unused code which adds cache_control in urlpatterns.
Link issue #949 and PR #1158