|
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 |
jtm Smarty Rookie
Joined: 13 Nov 2003 Posts: 9
|
Posted: Thu Nov 20, 2003 4:15 pm Post subject: custom cache handler function and is_cached |
|
|
It seems that when using custom cache handler function the call to is_cached executes the custom handler with 'read' action. This makes the handler to fetch the entire cache page from somewhere.
Because is_cache only need to know if the page is in cache or not, the custom cache handler function fetchs the cache data for nothing:
suggestion:
Add 'is_cache' action into the custom cache handler so that the developper who creates his own cache handler function can optimize this (for example, the function can just check if (file_exists(...)) without actually opening and reading the file.)
- jtm
edit: typos |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Thu Nov 20, 2003 4:47 pm Post subject: |
|
|
it is intended behaviour that is_cached() reads the file. this is regardless of a user defined cache_handler_func() or the built-in one. this avoids a race-condition that may occur between the is_cached() and the fetch() call. if is_cached() was called before then fetch() simply returns the page that was gathered with is_cached() before. |
|
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
|