Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

How do You Clear Your Cache?

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
Nick W
Smarty Rookie


Joined: 23 May 2003
Posts: 22

PostPosted: Tue Sep 02, 2003 7:01 am    Post subject: How do You Clear Your Cache? Reply with quote

I just realized that smarty does not automatically delete expired cache files. If I'd gone on holiday or somthing I'd have exceeded my disk space! Wink

I just set up a cron job to run clear_all_cache(86400) once a day, is that the best way to deal with it? - Or (and I'm thinking as I write) does Smarty only delete when it encounters an expired cache?

Many thanks

Nick
Back to top
View user's profile Send private message
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Tue Sep 02, 2003 7:36 am    Post subject: Reply with quote

i think setting up a cron-job is the best way to deal with it.

smarty does not delete the cached file when it encounters an expired one.
if display() encounters an expired cached file it regenerates the page and overwrites it with the new one. but you never have less cached files after display() than before.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Nick W
Smarty Rookie


Joined: 23 May 2003
Posts: 22

PostPosted: Tue Sep 02, 2003 8:27 am    Post subject: Reply with quote

Ahhh.. so there is a finite number of cached files then?

Thankyou.

Nick
Back to top
View user's profile Send private message
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Tue Sep 02, 2003 8:42 am    Post subject: Reply with quote

Nick W wrote:
Ahhh.. so there is a finite number of cached files then?


nope. after each call to display() you have more cached files or the same number than before. (of course it's finit by harddisk/universe-size - theoritical nitpicking - bla bla Smile ).

you'd have to ensure that your business-logic can only generate a finite number of distinct cache_ids to ensure you end up in a limited number of cached files.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Nick W
Smarty Rookie


Joined: 23 May 2003
Posts: 22

PostPosted: Tue Sep 02, 2003 9:44 am    Post subject: Reply with quote

So there can be 2 caches for a page? - An expired one, and a current one?

Nick
Back to top
View user's profile Send private message
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Tue Sep 02, 2003 9:52 am    Post subject: Reply with quote

no. there can be a 2 caches for a temlate if you have 2 different cache_ids. and, of course, each one expires on it's own.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Nick W
Smarty Rookie


Joined: 23 May 2003
Posts: 22

PostPosted: Tue Sep 02, 2003 12:53 pm    Post subject: Reply with quote

Sure. But not 2 ientical caches - because smarty overwrites expired caches right? .- I'm with you, finally hehe!

Cheers

Nick
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP