On Sun, 22 Feb 2009, James Cauwelier wrote:

> It wouldn 't be slower, but come with other difficulties.  Think about
> what happens when you want to clear the cache.  You would have to
> remove a huge number of files which would take quite a while.  This
> does not have to be a problem, but it may be that you won't be able to
> clear the cache with the symfony command.  Instead you would have to
> do it manually on the command line with find commands and stuff like
> that.
> 
> So, you would have faster pages, but a cache that is less manageable.
> You could remove the cache periodically with a cronjob or you could
> use some other form of caching.  Maybe you should opt for memcached
> instead of HTML file cache.

There are other ways to clear cache...

What we did was to write a 'clear cache' module, so updating a single item 
will automatically clear all associated pages by calling a specific URL in 
our 'cc' module with parameters specifying the object in question (since 
we know what cache keys we have used this is easy to do). Typically, 
thanks to globbing, the actual call to clear a cached object is just one 
or two method calls. Since partials are used across the site, clearing it 
once, clears it for all pages that use it, and the next request for it 
generates cache once for all pages that use it.

The actions in the cc module are built from primitives that clear a 
specific object (like a template fragment or a partial), so a page 
clearing action might call a few primitives to update the whole page.

In our case, our site is heavy wth content, so we have actions in the cc 
module to clear pages, category pages, specific partials on the home page, 
the whole homepage, etc etc. We used a filter to secure the module, so 
only HTTP GET requests from our backend app (on a separate secure server) 
is allowed to access those URLs.


-- 



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to