The sfViewCacheManager class checks the $_GET and $_POST global variables:
public function isCacheable($internalUri)
{
if (count($_GET) || count($_POST))
{
return false;
}
Fabien
--
Fabien Potencier
Sensio CEO - symfony lead developer
sensiolabs.com | symfony-project.com | aide-de-camp.org
Tél: +33 1 40 99 80 80
David Deller wrote:
> My problem is that caching is not used if any GET parameter is
> present, but we expect high traffic from links bearing this parameter
> (think referral/affiliation programs, etc.) so we need caching.
>
> Quoth the Book, Chapter 12:
>> Actions called with a POST method or with GET parameters are not cached.
>
> So my question is: how can I override this safeguard so that the cache
> filter believes there was no GET parameter?
>
> My filter executes before the cache filter, and once it does its
> processing, I can safely get rid of the parameter (it has no bearing
> on page content). But I haven't found a way to do this that will fool
> the cache filter.
>
> I have tried:
>
> class myFilter extends sfFilter
> {
> public function execute($filterChain)
> {
> $request = $this->getContext()->getRequest();
> $user = $this->getContext()->getUser();
>
> // ...processing...
>
> $request->getParameterHolder()->remove('my_param');
>
> $filterChain->execute();
> }
> }
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---