List Info

Thread: sfViewCacheManager enhancements




sfViewCacheManager enhancements
user name
2006-09-29 16:34:11
Hi

It's been a long time that i'm patching on my side every version of symfony with some personnal adjustements for the sfViewCacheManager. My functionnalities doesn't break backward compatibility, and are the following:

- adds a "global snipet" caching functionnality, i mean an html snipet which will use the same cache file whatever the action/module/request parameters that brought it are. It is backward compatible because you have to explicitaly call cache('global/.....',.....); to activate it.

- adds a "check" function to make it possible to know if a cache file is already present, very usefull in actions to avoid unnecessary requests.

- two new settings.yml configuration settings: 'cache_path_skip_hostname' and 'cache_path_skip_vary' to configure the way symfony will generate cache paths. Default is the old behaviour, but imagine you have all subdomains displaying the same site, then no need to cache different domains in different directories as they are the same.

Those enhancement were of course written for my personnal needs, but i think community could benefit from em (and me too as i wont have anymore manual patch to apply on every update :p)

Let me know what you think, so i can prepare a patch taking in account the community and core developpers opinions.

Hartym

sfViewCacheManager enhancements
user name
2006-10-02 07:04:08
Hi Romain,

I like your 'cache_path_skip_hostname' and
'cache_path_skip_vary' 
settings, it is a very good idea. You can create a ticket
and attach a 
patch on trac if you want.

I'm not sure to understand your "check" function.
What is the difference 
with the has() method?

As far as the "global snippet" is concerned, you
will be able to do that 
  in the next symfony release (not yet implemented) because
there will 
have a new parameter (sf_cache_key) that will let you decide
the cache 
key you want for your all cache types (component, fragment,
...).

Thanks,
Fabien

Romain Dorgueil wrote:
> Hi
> 
> It's been a long time that i'm patching on my side
every version of 
> symfony with some personnal adjustements for the
sfViewCacheManager. My 
> functionnalities doesn't break backward compatibility,
and are the 
> following:
> 
> - adds a "global snipet" caching
functionnality, i mean an html snipet 
> which will use the same cache file whatever the
action/module/request 
> parameters that brought it are. It is backward
compatible because you 
> have to explicitaly call cache('global/.....',.....);
to activate it.
> 
> - adds a "check" function to make it possible
to know if a cache file is 
> already present, very usefull in actions to avoid
unnecessary requests.
> 
> - two new settings.yml configuration settings: 
> 'cache_path_skip_hostname' and 'cache_path_skip_vary'
to configure the 
> way symfony will generate cache paths. Default is the
old behaviour, but 
> imagine you have all subdomains displaying the same
site, then no need 
> to cache different domains in different directories as
they are the same.
> 
> Those enhancement were of course written for my
personnal needs, but i 
> think community could benefit from em (and me too as i
wont have anymore 
> manual patch to apply on every update :p)
> 
> Let me know what you think, so i can prepare a patch
taking in account 
> the community and core developpers opinions.
> 
> Hartym
> 

--
To unsubscribe, e-mail: dev-unsubscribesymfony-project.com
For additional commands, e-mail: dev-helpsymfony-project.com

sfViewCacheManager enhancements
user name
2006-10-02 15:43:49
For the "global snipet" stuff, i think i either misunderstood your answer or either you isunderstood my feature.
What it basically provides is the ability of doing this:

<;?php if (!cache('global/stuff')): ?>
&nbsp; html code
<?php cache_save(); endif; ?>

It seems stupid, but the helper chen used in components is acting a bit strange, the component partial content is cached within the current action's path, instead of current's component path. I understand how much it's project dependent whether you'd like to cache it by component's internal uri or by action/module's internalUri as for examples menus could be generated different for each pages and some toplist coming from database could be cached globally for every page. I don't really understand what your key parameter permits, i saw it in the code and royally ignored it, as a copy paste of my 0.4 old patch was about enough to get the same comportment as 0.4, but let me know if it will enable this feature, so i can start looking forward to it.

I still didn't have the time to submit my patch, i suppose i'll send it this evening.

Best Regards

Hartym

2006/10/2, Fabien POTENCIER < fabien.potenciersymfony-project.com">fabien.potenciersymfony-project.com&gt;:
Hi Romain,

I like your 'cache_path_skip_hostname' and 'cache_path_skip_vary'
settings, it is a very good idea. You can create a ticket and attach a
patch on trac if you want.

I'm not sure to understand your "check" function. What is the difference
with the has() method?

As far as the "global snippet&quot; is concerned, you will be able to do that
 ; in the next symfony release (not yet implemented) because there will
have a new parameter (sf_cache_key) that will let you decide the cache
key you want for your all cache types (component, fragment, ...).

Thanks,
Fabien

Romain Dorgueil wrote:
>; Hi
>
&gt; It's been a long time that i'm patching on my side every version of
> symfony with some personnal adjustements for the sfViewCacheManager. My
> functionnalities doesn't break backward compatibility, and are the
> following:
>
> - adds a "global snipet&quot; caching functionnality, i mean an html snipet
&gt; which will use the same cache file whatever the action/module/request
> parameters that brought it are. It is backward compatible because you
> have to explicitaly call cache('global/.....',.....); to activate it.
>
> - adds a "check" function to make it possible to know if a cache file is
> already present, very usefull in actions to avoid unnecessary requests.
>
> - two new settings.yml configuration settings:
> 'cache_path_skip_hostname' and 'cache_path_skip_vary' to configure the
> way symfony will generate cache paths. Default is the old behaviour, but
> imagine you have all subdomains displaying the same site, then no need
> to cache different domains in different directories as they are the same.
>
> Those enhancement were of course written for my personnal needs, but i
> think community could benefit from em (and me too as i wont have anymore
&gt; manual patch to apply on every update :p)
>
&gt; Let me know what you think, so i can prepare a patch taking in account
&gt; the community and core developpers opinions.
>
> Hartym
>;

--
To unsubscribe, e-mail: dev-unsubscribesymfony-project.com">dev-unsubscribesymfony-project.com
For additional commands, e-mail: dev-helpsymfony-project.com">dev-helpsymfony-project.com


[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )