couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Newson <rnew...@apache.org>
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
ideal.

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
expectation.

B.

On 14 April 2012 07:52, Hendrik Jan van Meerveld <haaiee@gmail.com> 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 http://www.mysite.com/*
> 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
> https://wiki.apache.org/couchdb/Formatting_with_Show_and_List
> https://wiki.apache.org/couchdb/ExternalProcesses#JSON_Response
> but I cannot find any information on attachments (or probably I don't
> understand the information that I read).
>
> Kind regards,
> Hendrik Jan

Mime
View raw message