collective/eea.facetednavigation — pull request #1 by do3cc (2012-03-16 12:38:13+00:00)
Title: Hideous caching bug

Hi,

Sometimes, we had a broken faceted search view. It turned out that faceted_view.js was totally empty.
Faceted_view is a browser view that in turn gets a number of resources.
The way it retrieves the resources, the request headers are used and mangled.
Sometimes, this resulted in an empty js file, because extracting the single resources resulted in empty strings along with setting the response code to 304, not modified. But the faceted_view view still assembled the js file.

The way the resources are retrieved results in a browserview vom zope.browserresource.file.FileResource
This view provides NO way to get the file contents without messing up the headers. Its not meant to be used liked that.

To avoid this header messing, the patch retrieves the resoures with a TestRequest. This test request sets no caching headers so no 304 response can be expected.
I am not happy with this solution. I'd load the resources directly via portal_javascripts, but I guess this construct to assemble your own javascript must be there for a reason, so I created a pull request to spark a discussion. Lets see how this works out :-)