Skip to content
● Grav 2.2 is out: 2x faster cold starts and 96% less memory on big sites. Read the announcement →

Kick cache for certain sites on Saving others

admin

Started by Hubi Schulze 9 years ago · 3 replies · 1013 views
9 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?

9 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

9 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 stell, 7 days ago
5 238 11 minutes ago
Support · by gravinator, 1 month ago
5 453 2 hours ago
Support · by Gravver, 2 weeks ago
6 280 1 week ago
Support · by Marcel, 4 weeks ago
2 338 1 week ago
Support · by blu3prince, 2 weeks ago
1 255 2 weeks ago