On Wed, Nov 25, 2009 at 2:29 AM, Lea H <[email protected]> wrote: > Hi, > I have an image like that <img src='controller/action' /> that calls > action in controller. This action creates a PIL and sends it to the > browser. It seems that once the action was called the resulting image > is cached and reused every time the image is shown (the action is not > called anymore). Since the image contains dynamic data I need it to be > re-created every time I go on that page. Can I somehow tell the > browser not to cache that specific image? > > Thanks for you help. > > Cheers, > Lea > > -- > > 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]<pylons-discuss%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/pylons-discuss?hl=en. > > >
Lea, There are a few things you can do to disable caching, the oldest way is to append a timestamp into the url so the image url is different on every request. EX: """<img src="/controller/image?time=%s">""" % time.time() then in your controller ensure you except the time argument or you can use cache-control/max-age headers on the returning image, to tell the browser to refresh. However this does tend to be browser specific and can be fun finding the right headers to return for all browsers. Hope this helps, Vince -- 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.
