A workaround I use is to format the GET url in a symfony "friendly"
way.

i.e. instead of:
http://youdomain.com/module/action?param1=x&param2=y

Use:
http://youdomain.com/module/action/param1/x/param2/y

This magically makes the cache work. No love with POST though. I even
went so far as to change my scriptaculos.js and prorotype.js to use
this alternate URL scheme so that everything "just works".


On Jan 21, 1:46 am, David Deller <[email protected]> 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to