couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Newson <>
Subject Re: How to set cache-control headers for attachments
Date Sat, 14 Apr 2012 11:57:47 GMT
You can't currently control response headers for attachments. You can
add some proxy middleware fairly easily, though I concede it's not

The fundamental problem here is that you want to lose cache coherency
for performance reasons. That is, you want to allow the possibility
that a GET will return 304 (Not Modified) even if the item has been
modified. Out of the box, CouchDB won't allow you to violate that


On 14 April 2012 07:52, Hendrik Jan van Meerveld <> wrote:
> Hi Couchdb people,
> Can I set headers for attachments?
> I'd like to add headers like
>  Cache-Control: max-age=3600, must-revalidate
>  ExpiresDefault "access plus 10 years"
>  CacheQueries PUBLIC*
> to image attachments in my couchapp website.
> Because the site is mainly for mobiles, it is very important for me to
> reduce the amount of data and number of HTTP requests.
> Couchdb user Rober Newson gave me useful information on how to set headers
> for lists and shows
> but I cannot find any information on attachments (or probably I don't
> understand the information that I read).
> Kind regards,
> Hendrik Jan

View raw message