On 02/02/2010 09:07 PM, Andy (Zenom) wrote:
> Basically I have a site that I need to carry an affiliate code
> through, but would like to cache the final template result, minus that
> one variable.  This way all the major part of the content is cached,
> but the affiliate code can be inserted into the template as normal and
> not cached. Caching the entire site for each affiliate code is not
> really an option as we have 3k+ affiliates.
>
> Someone in IRC said write a wrapper, but having a hard time wrapping
> my head around this, since the data I need to cache is all in the
> controller and there could be multiple queries etc. If I wrap the
> render method somehow, then the queries are still going to run before
> the cache render function would run.
>
> Any help would be greatly appreciated. Samples also more than
> welcome :)
>
>   

Without more details on what do you intend to do with the affiliate code
(format links, present code-dependent data blocks, ...), I can think of
two relatively simple solutions:

1. single affiliate entry point URL, where the code is recorded,
inserted into the session and then carried through the session only
2. use some async javascript magick (aka AJAX) to fetch the code only
and format the links or modify the HTML, all client side. That would
increase number of hits per page, but you can benefit from client side
caching.


Vlad

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" 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/pylons-discuss?hl=en.

Reply via email to