Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A7E719172 for ; Sat, 14 Apr 2012 12:09:48 +0000 (UTC) Received: (qmail 98750 invoked by uid 500); 14 Apr 2012 12:09:47 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 98709 invoked by uid 500); 14 Apr 2012 12:09:47 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 98700 invoked by uid 99); 14 Apr 2012 12:09:47 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 14 Apr 2012 12:09:47 +0000 X-ASF-Spam-Status: No, hits=3.1 required=5.0 tests=HK_RANDOM_ENVFROM,HK_RANDOM_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of haaiee@gmail.com designates 209.85.214.180 as permitted sender) Received: from [209.85.214.180] (HELO mail-ob0-f180.google.com) (209.85.214.180) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 14 Apr 2012 12:09:42 +0000 Received: by obbwc20 with SMTP id wc20so2901363obb.11 for ; Sat, 14 Apr 2012 05:09:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=dQPfwzb8NvVXKHJSuwqesZhBEcjiFDo4jaClAWM8gkI=; b=uvNpBMBz4ZG4rrB/BTqnzAMURIXC7Bsi8j0AVautkfqZHtE6DIeh4omnKduGpb+21V UScpEQ2J69JuHJ2Yfn6mdC6oUwAfPIqu1uDYumFllCzlv/pvLdMrDQGtMt9CRmKhdM2M hex7rUblJRv/sFmPPnpkwIm9zoWYHMmWLW/eseRquXYDM7VAOpdRKSbg7krUCicrke5C KAE0SwkFKCA3R6W9nY5mf78lii91QxZ68Br1toIJMFIA3Y0AmVZqxyYQAcTdUHxEadSP Blq4LOFHOBMmMVeSOyMXhhpgLL1IdMQr/lWdIJx5rtPBZc2WIzrkYsdzzVSNTLLrgTj3 lTjw== Received: by 10.182.36.3 with SMTP id m3mr6851646obj.8.1334405361481; Sat, 14 Apr 2012 05:09:21 -0700 (PDT) MIME-Version: 1.0 Received: by 10.182.43.105 with HTTP; Sat, 14 Apr 2012 05:08:51 -0700 (PDT) In-Reply-To: References: From: Hendrik Jan van Meerveld Date: Sat, 14 Apr 2012 14:08:51 +0200 Message-ID: Subject: Re: How to set cache-control headers for attachments To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=f46d04447f9f8eb74204bda275b8 X-Virus-Checked: Checked by ClamAV on apache.org --f46d04447f9f8eb74204bda275b8 Content-Type: text/plain; charset=ISO-8859-1 Thank you again Robert. I added some rules to the Nginx proxy that I was using allready. This is a good enough solution for my requirements. I needed a proxy anyway because I wanted to hide some parts of Couchdb from the outer world. Kind regards, Hendrik Jan On 14 April 2012 13:57, Robert Newson wrote: > 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 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 > --f46d04447f9f8eb74204bda275b8--