Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Support

Kick cache for certain sites on Saving others

admin

Started by Hubi Schulze 8 years ago · 3 replies · 802 views
8 years ago

I made a one-pager theme which builds up parts from entries of sub-pages
In that case it's dogs:

  • So a Dog has 4 fields (name, short_text,long_text,images)
  • the short-text, name and the first image is used to show up on the home-page in something like a view
  • the long-text and all the images show up on a sub-page when you click on one of the entries in the home page
  • so the part of the home page showing those dog-entries is a modular with page.find('/dogs').children loop in the twig-template

my problem
When I update or add a dog (so a sub-page) I would like to kick the cache for the home-page so that it show the new entry as soon as it is saved. Otherwhise the editor has to kick the cash manually every time it adds a new dog to the system.

my question
Is there a way to tell a grav to selectively refresh the cache for a certain page when saving a certain other page-type?

8 years ago

Hi @paulhibbitts

That would probably work, but then my home page is not cached at all.

I want to update the cache of site A (modular page) when site B (some other regular sub-page) is added/saved/deleted.

35|296x500

8 years ago

Is it an option just to leave the Cache off? Otherwise I do not know myself how you might do what you are asking.

Suggested topics

Topic Participants Replies Views Activity
Support · by Thomas, 1 week ago
2 56 13 hours ago
Support · by Anna, 3 days ago
2 61 16 hours ago
Support · by Justin Young, 17 hours ago
1 32 17 hours ago
Support · by Duc , 1 week ago
2 66 5 days ago
Support · by Colin Hume, 1 week ago
2 59 5 days ago