Primary links

Proxy Caching

Is there a way to prevent proxy caching?   My xforms are being cached off by our proxy and I have no way to see changes.   This often happens when I make javascript errors but I am able to browse to them by entering the URL of the js file and reloading the page.   However I cannot do that to xforms.   

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
edc's picture

use cache-control headers

Hi George,

Proxy caching is best controlled with Expires and Cache-Control headers.

For deployment, apache is serving the files and sets all the headers.

For development, the headers are set by our modpython. However, since we change the URL of every request, caching shouldn't be an issue.

Hope this is helpful.

References:

http://www.mnot.net/cache_docs/#CACHE-CONTROL

http://httpd.apache.org/docs/1.3/mod/mod_headers.html

small's picture

I did some quick tests using

I did some quick tests using a local proxy (Squid, default configuration) and an application deployed to a local server.  The proxy seems to cache the right stuff; static files (.js files, GIFs, etc) are cached, while the XForm POSTs were not.  I was able to change an XForm, and without restarting either the server or the proxy I was able to see the changes.

 

For the XForm POSTs, we set the "Pragma: no-cache" and "Cache-control: no-cache" headers.  More importantly, we change the URL of every request, so proxies should never cache the results.

 

This was a really simple test, so I'm sure I'm missing something.  If you're still seeing this, could you post a quick walkthrough of what you're doing, and some more information about your environment (browser version, proxy type, whether this is a deployed application).

 

Thanks,

Matt

This is what I was seeing

I have 3 instances where the contents of an AjaxFrame (housing my XForm) could get loaded.

1.   Default Load (Ajax Init)

2.   Based on DropDown Submit

3.  Tab Click

 

Areas 2 & 3 were showing cached versions of the page.   This is what I was seeing.   I had a button that I changed to an image link.   So the correct thing that should be showing was the image link, but this is what I was seeing

 

1.  Default Load (Ajax Init) -  Image Link

2.  Based on DropDown Submit - Button (cached)

3.  Tab Click - Button (cached)

 

As of now things are all OK but just was curious in case I ran into the situation again how to refresh an XForm if the proxy caches it.