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

Time limit cache

Started by Muut Archive 10 years ago · 2 replies · 336 views
10 years ago

Hello awesome community,
I'm trying to speed up my website using the cache system but I'm facing a problem I do not know how to solve. I have a plugin that reads a json file with opening times, opening days, hoilidays bla bla bla and compare them to the actual date:time printing out in a page if the activity is open or closed etc. etc. It works and I'm proud of it.
The problem happens when I active the cache: the page is cached (yeah) but when it tries to print the current date:time it stamps the time when the page was cached, so I lose its utility.
How can I use the cache system and the realtime date:time check? Can i say "hey cache, check me again in xx minutes"?

10 years ago

if your page needs to be dynamic, why dont' you simply turn off the page cache for that one page with a cache_enable: false in the page header? The site will still run fast, but that one page's content will not be cached.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1359 9 years ago
Archive · by Muut Archive, 9 years ago
2 936 9 years ago
Archive · by Muut Archive, 9 years ago
2 4066 9 years ago
Archive · by Muut Archive, 9 years ago
1 2955 9 years ago
Archive · by Muut Archive, 9 years ago
3 1121 9 years ago