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

Fixes caching #2179

Merged
merged 4 commits into from
Aug 20, 2021
Merged

Fixes caching #2179

merged 4 commits into from
Aug 20, 2021

Conversation

tvdeyen
Copy link
Member

@tvdeyen tvdeyen commented Aug 19, 2021

What is this pull request for?

This contains several fixes for http caching.

  1. It stores the page id instead of the full page instance as current preview in the request store
  2. It removes the element cache_key override since it is not necessary anymore due to the page versions work
  3. It always returns the published_at value from the database for a page
  4. It touches the page versions page on update

Read the commit messages for background

Checklist

  • I have followed Pull Request guidelines
  • I have added a detailed description into each commit message
  • I have added tests to cover this change

@tvdeyen tvdeyen added this to the 6.0 milestone Aug 19, 2021
@tvdeyen tvdeyen requested review from a team and removed request for a team August 19, 2021 09:15
@tvdeyen tvdeyen marked this pull request as draft August 19, 2021 09:52
@tvdeyen tvdeyen self-assigned this Aug 19, 2021
@tvdeyen tvdeyen changed the title Remove Page#published_at overwrite Fixes caching Aug 19, 2021
We need the value from the database in all cases in order to be able
to use it as the last_modified header. The overwrite is not necessary
for the cache_key (ETag header) since it already takes the use case
for admins into account.
Instead of storing the class instance in the request store
we store the id. That way we are able to set a page as the current preview
from another request (ie. a page fetched from an API)
Now that elements get copied over to a new page version on publish the
cache key can be the default rails cache key again.
@tvdeyen tvdeyen force-pushed the remove-published_at-override branch from fa841c1 to 329d257 Compare August 19, 2021 10:22
@tvdeyen tvdeyen marked this pull request as ready for review August 19, 2021 11:20
@tvdeyen tvdeyen requested a review from mamhoff August 19, 2021 11:20
Copy link
Contributor

@mamhoff mamhoff left a comment

Choose a reason for hiding this comment

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

SIMPLIFICATIONS!!!

@tvdeyen tvdeyen merged commit c0fb12f into AlchemyCMS:main Aug 20, 2021
@tvdeyen tvdeyen deleted the remove-published_at-override branch August 20, 2021 05:38
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.

2 participants