|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
Nick W Smarty Rookie
Joined: 23 May 2003 Posts: 22
|
Posted: Tue Sep 02, 2003 7:01 am Post subject: How do You Clear Your Cache? |
|
|
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!
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 |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Tue Sep 02, 2003 7:36 am Post subject: |
|
|
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 |
|
Nick W Smarty Rookie
Joined: 23 May 2003 Posts: 22
|
Posted: Tue Sep 02, 2003 8:27 am Post subject: |
|
|
Ahhh.. so there is a finite number of cached files then?
Thankyou.
Nick |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Tue Sep 02, 2003 8:42 am Post subject: |
|
|
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 ).
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 |
|
Nick W Smarty Rookie
Joined: 23 May 2003 Posts: 22
|
Posted: Tue Sep 02, 2003 9:44 am Post subject: |
|
|
So there can be 2 caches for a page? - An expired one, and a current one?
Nick |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Tue Sep 02, 2003 9:52 am Post subject: |
|
|
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 |
|
Nick W Smarty Rookie
Joined: 23 May 2003 Posts: 22
|
Posted: Tue Sep 02, 2003 12:53 pm Post subject: |
|
|
Sure. But not 2 ientical caches - because smarty overwrites expired caches right? .- I'm with you, finally hehe!
Cheers
Nick |
|
Back to top |
|
|
|
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
|