Purge Cache at 00 o'clock

LuigiMdg

Active Member
#1
Salutations,
as the title suggests, would it be possible to trigger those 3600 seconds exactly at **: 00:00..?

Thanks in advance to anyone who will take a moment to answer me.
 

serpent_driver

Well-Known Member
#3
Yes, it is possible, but with a max delay of ~ 1 min. This can be done with cURL and a cron that checks every minute if x-litespeed-cache header is miss and if header is miss you can be notified per email or almost everything you want to.
 
Last edited:

LuigiMdg

Active Member
#4
use cron job to clean lscache dir
Obviously I wanted to avoid cleaning, as there was already a rather short timeout
Yes, it is possible, but with a max delay of ~ 1 min. This can be done with cURL and a cron that checks every minute if x-litespeed-cache header is miss and if header is miss you can be notified per email or almost everything you want to.
I have a timeout on a module set to 3600 seconds.
The module predicts delivery time, so it works fine when the hours tick, while the timeout expires based on when the cache was created.
I don't think I would be able to solve with a cron.
 

serpent_driver

Well-Known Member
#5
Maybe there is a much simplier solution, but it depends on this "module" you are talking about. It must trigger itself and if specified time passed by it does a request to an almost empty PHP file that contains only a header to purge the cache.

Code:
header("X-LiteSpeed-Purge:*"); // purges the entire cache and should be specified if necessary
That's it.
 

AndreyPopov

Well-Known Member
#6
I have a timeout on a module set to 3600 seconds.
timeout or cache TTL (Time To Live)?

what you want:
- Purge cache
- or check if cache exist

if you want to regenerate cache than start crawler by cron, for example, every 30 minutes

if "hit" - item passed
if "miss" - cache created and sets to "hit"
 

LuigiMdg

Active Member
#9
You don't seem to be able to understand me.. But I think I have solved it.
I made the lock private, set the timeout to 3600 seconds, then cleared the private ESI cache at 22:00, certainly more synchronized but I have not yet checked if at 22:00 it is updated correctly or if some time passes before.
 

AndreyPopov

Well-Known Member
#11
I made the lock private, set the timeout to 3600 seconds
this is NOT timeout.
this is Time To Live of cache

esi_ttl.jpg

cache expired after 3600 second after create.
if you request exist page in cache and cache not expired yet then you get page from cache.
if requested page not exist in cache or cache of this page expired then new cache generating with TTL 3600 seconds.
after 3600 seconds after create you cache always purged and created new on next request.


certainly more synchronized
you want synchronized main private cache (with TTL 3600) and ESI cache?
 
Last edited:

LuigiMdg

Active Member
#12
this is NOT timeout.
this is Time To Live of cache

View attachment 2807

cache expired after 3600 second after create.
if you request exist page in cache and cache not expired yet then you get page from cache.
if requested page not exist in cache or cache of this page expired then new cache generating with TTL 3600 seconds.
after 3600 seconds after create you cache always purged and created new on next request.




you want synchronized main private cache (with TTL 3600) and ESI cache?
this is NOT timeout.
this is Time To Live of cache

View attachment 2807

cache expired after 3600 second after create.
if you request exist page in cache and cache not expired yet then you get page from cache.
if requested page not exist in cache or cache of this page expired then new cache generating with TTL 3600 seconds.
after 3600 seconds after create you cache always purged and created new on next request.




you want synchronized main private cache (with TTL 3600) and ESI cache?
It's called TTL, not timeout, you're right about that, but anyway, it doesn't work!
 

AndreyPopov

Well-Known Member
#15
Because I don't want to purge the whole page, just that block.
if I know, LSWS can purge cache of whole url(page)
if you purge cache of url then all types of cache for this page purged.

LSWS has script \admin\misc\purge_cache_by_url

or you can purge:
- all cache of all pages
- all public cache of all pages
- all private cache of all pages
 

LuigiMdg

Active Member
#19
if I know, LSWS can purge cache of whole url(page)
if you purge cache of url then all types of cache for this page purged.

LSWS has script \admin\misc\purge_cache_by_url

or you can purge:
- all cache of all pages
- all public cache of all pages
- all private cache of all pages
I feel like I'm talking to a wall

Yes, that works, but not for cache of ESI holes and the current case is about a ESI hole.
Exactly.. Thank you serpent_driver
 
Top