Question

I am using CouchDB for a web app and having problems with IE8 caching the results of a view. From my reading it seems one solution would be to change the "Cache-Control" HTTP header to "no-cache". Right now the CouchDB returns the value "must-revalidate".

Is there a way to change the value of this header at all? Can it just be changed for the view?

Was it helpful?

Solution

CouchDB should be using Etags that change whenever the view content or code changes. However, looking through CouchDB's bug database it looks like there is a cache issue with Internet Explorer that's been unsolved for a while. If that looks like the problem you're having, it might be helpful to propose a fix in the bug ticket or at least remind the CouchDB mailinglist/IRC of the issue.

It looks like the issue is simply IE's bug though, so some sort of workaround might be necessary, like querying the view with the age old extra random parameter hack to make the URL unique when you know you would otherwise encounter a cache issue.

OTHER TIPS

FYI if you are using jQuery just remember to include cache:false as one of your options in your $.ajax() calls.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top