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

FR: Static cache invalidation when deleting content #1122

Closed
dannyuk1982 opened this Issue Nov 22, 2016 · 8 comments

Comments

Projects
None yet
2 participants
@dannyuk1982

dannyuk1982 commented Nov 22, 2016

Expected behaviour

When a page is deleted it should be removed from the navigation

Actual behaviour

The newly removed page does not update in the navigation until another the cache is cleared

Steps to reproduce

  1. Make sure Static page caching (half measure) is on
  2. Delete a page
  3. Check the nav & page - as before the deletion
  4. Clear the cache - the nav updates and the page is now a 404

Server configuration

Operating system:
centos

Web server:
apache

PHP version:
7

Statamic version:
2.2.18

Updated from an older Statamic or fresh install:
Updated

List of installed addons:
none

@dannyuk1982

This comment has been minimized.

dannyuk1982 commented Nov 22, 2016

same thing is happening with entries

@jasonvarga

This comment has been minimized.

Member

jasonvarga commented Jan 20, 2017

This makes sense because you've statically cached a page, and there's currently no rule for what URLs should get invalidated when a page gets deleted.

This issue should instead of being a considered a bug, it should be an (absolutely reasonable) feature request for invalidating stuff when content is deleted.

@jasonvarga jasonvarga changed the title from deleted pages do not remove from nav until cache is cleared manually to FR: Static cache invalidation when deleting content Jan 20, 2017

@dannyuk1982

This comment has been minimized.

dannyuk1982 commented Jan 20, 2017

That is confusing if that is by design then, when it says this on that page:

screen shot 2017-01-20 at 19 18 43

It definitely needs to be an option then, as otherwise the CP + caching makes no sense for the end user (without installing EMD's powertools and telling them to click "clear cache" after every change)

@jasonvarga

This comment has been minimized.

Member

jasonvarga commented Jan 20, 2017

The setting you just screenshotted is about updating the Stache.
The Stache does get updated when you edit something in the CP.

The Stache is completely separate from the Static Cache.
The Static Cache is a whole other level of caching. That's what needs to be cleared.

I'm saying what you're essentially asking for should exist in Statamic. It's just not a "bug".

@dannyuk1982

This comment has been minimized.

dannyuk1982 commented Jan 20, 2017

How does this work with static_caching_invalidation as well? Because, e.g. I have this for blog

  collections:
    blog:
      urls:
        - /
        - /about-us/blogs
        - '/about-us/blogs/*'
        - '/about-us/staff/*'

Yet deleting a blog item does not update /about-us/blogs

@dannyuk1982

This comment has been minimized.

dannyuk1982 commented Jan 20, 2017

Ah OK - I think I understand. The difference between Stache and Static Cache in my mind is a bit muddy!

@jasonvarga

This comment has been minimized.

Member

jasonvarga commented Jan 20, 2017

Please re-read my earlier comment.

I said nothing is invalidated when something gets deleted. It should.

@dannyuk1982

This comment has been minimized.

dannyuk1982 commented Jan 20, 2017

I think I wrote that about 2 seconds after you posted - I getcha

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment