we have a noncachingimage subclass... :) -igor
On Sun, Mar 18, 2012 at 9:33 PM, Bertrand Guay-Paquet <[email protected]> wrote: > Hi, > > I have image resources which fetch the proper thumbnail picture stored in a > DB based on the image's file name. I used the file name instead of > parameters to make sure client-side caching would work. By chance, I just > discovered that the images are always reloaded on ajax requests. > > This is caused by Image#shouldAddAntiCacheParameter and > Image#addAntiCacheParameter which always add an "anticache" parameter to > image src URLs on ajax requests. > > In my case, the images are added to ajax requests as part of a table update > containing lots of thumbnails so it's definitely counter-productive. I can > see the need for anticaching for dynamically generated images which change > per request, but should this be the default behavior? > > Of course, I can easily work around this issue by subclassing Image, but I > wanted to bring this to attention. At the very least, I would suggest > creating a subclass (CachingImage?) of Image in core which does not do > anticaching for stateless resource references. > > Regards, > Bertrand > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
