Return-Path: X-Original-To: apmail-httpd-users-archive@www.apache.org Delivered-To: apmail-httpd-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8D80EEBEF for ; Mon, 18 Feb 2013 11:55:17 +0000 (UTC) Received: (qmail 51802 invoked by uid 500); 18 Feb 2013 11:55:14 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 51141 invoked by uid 500); 18 Feb 2013 11:55:07 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 51100 invoked by uid 99); 18 Feb 2013 11:55:06 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Feb 2013 11:55:05 +0000 X-ASF-Spam-Status: No, hits=-0.5 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of nicolas.daniels63@gmail.com designates 209.85.215.169 as permitted sender) Received: from [209.85.215.169] (HELO mail-ea0-f169.google.com) (209.85.215.169) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Feb 2013 11:54:57 +0000 Received: by mail-ea0-f169.google.com with SMTP id d13so2280742eaa.14 for ; Mon, 18 Feb 2013 03:54:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=d+vKipSbQGkRYNQoAwwjkzCtgL8rXAEn8vXDt4LP1o8=; b=qMfiOipn39BBFkqx+pl2tYJYyX25++0aVy8rx6mrGP9vK3nu9/BsEs8pqCvilcxmsn 9QtxAumMGFZEhhV8OuhyOxiTEQkxwHvx8COHfV6U7ZzIxTrNQVKVh92uBo6XCeYqzN+p Iqh3GXgc0kZHCWPFbMavaxTiQEnCO9Q5Iwlmljjfx0By/NmSosHw0V+9zGQ8aZlKw19Z zgtQ4YYXy1CX3XeCwmKt5vc5VxdNW/t//uTKLvU+NYac9esKpmIMxcOOpmqahm0JSyqa MoCtSO/ObFzhO6PoauqrAT2SRjNQ9e0+5ryyrrPoeCNxP4B5PyD447q8UOf+g89xMMNI FrBg== X-Received: by 10.14.215.193 with SMTP id e41mr44067118eep.32.1361188476464; Mon, 18 Feb 2013 03:54:36 -0800 (PST) Received: from [10.3.34.100] ([194.78.223.33]) by mx.google.com with ESMTPS id m46sm33967691eeo.16.2013.02.18.03.54.34 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 18 Feb 2013 03:54:35 -0800 (PST) Sender: Nicolas Daniels Message-ID: <5122166C.9080000@swing.be> Date: Mon, 18 Feb 2013 12:54:20 +0100 From: Nicolas Daniels User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 MIME-Version: 1.0 To: users@httpd.apache.org References: <511D05C5.6070904@bluepimento.eu> In-Reply-To: <511D05C5.6070904@bluepimento.eu> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Subject: [users@httpd] Re: Apache 2.4: Mod Cache: authorization required Hello, Ok I figured out how to allow caching for authenticated urls: adding "Cache-Control" header with public option do the trick. Now I still have the problem that the cache key is built upon the url BEFORE the rewrite occurs. Is it possible to change this behavior ? I tried with AddOutputFilterByType REWRITE;CACHE text/html But rewrite is not a filter (or I don't have the appropriate name). Thanks, Nicolas On 14/02/2013 16:41, Nicolas Daniels wrote: > Hi all, > > I'm trying hard to configure mod_cache with mod_cache_disk and apache > 2.4, without real success. > > I'm able to enable cache for public files (no authentication), but not > for private ones. From my understanding, setting |CacheQuickHandler to > off |should have done the trick, but it keeps complaining in the logs: > > [Thu Feb 14 15:20:18.997941 2013] [cache:debug] [pid 18018:tid > 140317277726464] mod_cache.c(1073): [client xxxxxxxx] AH00768: cache: > /file/files/test.txt not cached. Reason: Authorization required > > Looking around for a solution to this problem, I found also another > one: cache key is computed before rewrite rule applies, which will > lead to issues as I'm rewriting the logged use in the url. > > My config (part of): > > > AuthType Digest > AuthName "bla" > # To cache credentials, put socache ahead of dbd here > AuthDigestProvider socache dbd > # Also required for caching: tell the cache to cache dbd lookups! > AuthnCacheProvideFor dbd > AuthnCacheContext blabla > > Require valid-user > AuthDBDUserRealmQuery "SELECT digestpwd FROM user WHERE name= %s" > > > RewriteCond %{REQUEST_METHOD} GET > RewriteCond %{LA-U:REMOTE_USER} ([0-9]+) > RewriteRule ^/file/(.*) /data/%1/$1 [L] > > > > LogLevel cache:trace8 > CacheQuickHandler off > CacheRoot /tmp/apachecache > CacheEnable disk / > CacheDefaultExpire 120 > CacheIgnoreURLSessionIdentifiers jsessionid JSESSIONID > > > > Any way to get around those problems ? > > Thanks a lot for your help ! > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org For additional commands, e-mail: users-help@httpd.apache.org