Return-Path: Delivered-To: apmail-httpd-users-archive@www.apache.org Received: (qmail 98357 invoked from network); 7 Dec 2007 07:54:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Dec 2007 07:54:27 -0000 Received: (qmail 97553 invoked by uid 500); 7 Dec 2007 07:54:04 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 97532 invoked by uid 500); 7 Dec 2007 07:54:04 -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 97521 invoked by uid 99); 7 Dec 2007 07:54:04 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Dec 2007 23:54:04 -0800 X-ASF-Spam-Status: No, hits=-2.5 required=10.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [193.56.114.156] (HELO smtp2.fr.adp.com) (193.56.114.156) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Dec 2007 07:54:05 +0000 Received: from exchange2k304.gaia.fr ([150.175.10.77]) by smtp2.fr.adp.com (xx/xx) with ESMTP id lB77riPU024894 for ; Fri, 7 Dec 2007 08:53:44 +0100 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Date: Fri, 7 Dec 2007 08:53:31 +0100 Message-ID: In-Reply-To: <475861F1.7020701@ixonos.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [users@httpd] Reverse proxy cache control problems Thread-Index: Acg4Sopz4nOWBLTOSgmyJp1DPHp0uQAW26fA References: <475861F1.7020701@ixonos.com> From: "Axel-Stephane SMORGRAV" To: X-Virus-Checked: Checked by ClamAV on apache.org Subject: RE: [users@httpd] Reverse proxy cache control problems Could you possibly post the headers returned by = http://localhost:5050/cachetest/jsp/cacheable/main.jsp along with your = proxy configuration directives? The request headers could also be relevant. If you use Mozilla Firefox, = you can obtain these headers using the add-on LiveHTTPHeaders. -ascs ____________________________________________ -----Message d'origine----- De : Marko Asplund [mailto:marko.asplund@ixonos.com]=20 Envoy=E9 : jeudi 6 d=E9cembre 2007 21:56 =C0 : users@httpd.apache.org Objet : [users@httpd] Reverse proxy cache control problems hi I'm trying to cache dynamically generated content using an Apache 2.2=20 reverse proxy. Apache proxies content coming from Tomcat through AJP protocol. For some reason mod_cache determines that cacheable content is not fresh = and refetches the content though the application sets the Expires and Cache-Control HTTP response=20 headers (see below). I'd like to be able to always cache cacheable pages for a certain period = of time without any further freshness validation and force non-cacheable pages to be excluded from caching. How should I set the response headers and configure mod_cache in order=20 to do that? Marko Here's a debug log extract from a page load: [Thu Dec 06 22:25:35 2007] [debug] mod_disk_cache.c(477): disk_cache:=20 Recalled cached URL info header=20 http://localhost:5050/cachetest/jsp/cacheable/main.jsp? [Thu Dec 06 22:25:35 2007] [debug] mod_disk_cache.c(750): disk_cache:=20 Recalled headers for URL=20 http://localhost:5050/cachetest/jsp/cacheable/main.jsp? [Thu Dec 06 22:25:35 2007] [debug] cache_storage.c(272): Cached response = for /cachetest/jsp/cacheable/main.jsp isn't fresh. Adding/replacing=20 conditional request headers. [Thu Dec 06 22:25:35 2007] [debug] mod_cache.c(129): Adding CACHE_SAVE=20 filter for /cachetest/jsp/cacheable/main.jsp [Thu Dec 06 22:25:35 2007] [debug] mod_cache.c(136): Adding=20 CACHE_REMOVE_URL filter for /cachetest/jsp/cacheable/main.jsp [Thu Dec 06 22:25:35 2007] [debug] mod_proxy_ajp.c(44): proxy: AJP:=20 canonicalising URL //127.0.0.1:8009/cachetest/jsp/cacheable/main.jsp [Thu Dec 06 22:25:35 2007] [debug] proxy_util.c(1378): [client=20 127.0.0.1] proxy: ajp: found worker ajp://127.0.0.1:8009/cachetest for=20 ajp://127.0.0.1:8009/cachetest/jsp/cacheable/main.jsp [Thu Dec 06 22:25:35 2007] [debug] mod_proxy.c(777): Running scheme ajp=20 handler (attempt 0) [Thu Dec 06 22:25:35 2007] [debug] mod_proxy_http.c(1652): proxy: HTTP:=20 declining URL ajp://127.0.0.1:8009/cachetest/jsp/cacheable/main.jsp [Thu Dec 06 22:25:35 2007] [debug] mod_proxy_ajp.c(507): proxy: AJP:=20 serving URL ajp://127.0.0.1:8009/cachetest/jsp/cacheable/main.jsp [Thu Dec 06 22:25:35 2007] [debug] proxy_util.c(1798): proxy: AJP: has=20 acquired connection for (127.0.0.1) [Thu Dec 06 22:25:35 2007] [debug] proxy_util.c(1859): proxy: connecting = ajp://127.0.0.1:8009/cachetest/jsp/cacheable/main.jsp to 127.0.0.1:8009 [Thu Dec 06 22:25:35 2007] [debug] proxy_util.c(1955): proxy: connected=20 /cachetest/jsp/cacheable/main.jsp to 127.0.0.1:8009 [Thu Dec 06 22:25:35 2007] [debug] proxy_util.c(2050): proxy: AJP: fam 2 = socket created to connect to 127.0.0.1 [Thu Dec 06 22:25:35 2007] [debug] ajp_header.c(218): Into=20 ajp_marshal_into_msgb [Thu Dec 06 22:25:35 2007] [debug] ajp_header.c(284):=20 ajp_marshal_into_msgb: Header[0] [Host] =3D [localhost:5050] [Thu Dec 06 22:25:35 2007] [debug] ajp_header.c(284):=20 ajp_marshal_into_msgb: Header[1] [User-Agent] =3D [Mozilla/5.0 (X11; U;=20 Linux i686; en-US; rv:1.9b1) Gecko/2007110903 Firefox/3.0b1] [Thu Dec 06 22:25:35 2007] [debug] ajp_header.c(284):=20 ajp_marshal_into_msgb: Header[2] [Accept] =3D=20 [text/html,application/xhtml+xml,application/xml;q=3D0.9,*/*;q=3D0.8] [Thu Dec 06 22:25:35 2007] [debug] ajp_header.c(284):=20 ajp_marshal_into_msgb: Header[3] [Accept-Language] =3D = [en-us,en;q=3D0.5] [Thu Dec 06 22:25:35 2007] [debug] ajp_header.c(284):=20 ajp_marshal_into_msgb: Header[4] [Accept-Encoding] =3D [gzip,deflate] [Thu Dec 06 22:25:35 2007] [debug] ajp_header.c(284):=20 ajp_marshal_into_msgb: Header[5] [Accept-Charset] =3D=20 [ISO-8859-1,utf-8;q=3D0.7,*;q=3D0.7] [Thu Dec 06 22:25:35 2007] [debug] ajp_header.c(284):=20 ajp_marshal_into_msgb: Header[6] [Keep-Alive] =3D [300] [Thu Dec 06 22:25:35 2007] [debug] ajp_header.c(284):=20 ajp_marshal_into_msgb: Header[7] [Connection] =3D [keep-alive] [Thu Dec 06 22:25:35 2007] [debug] ajp_header.c(284):=20 ajp_marshal_into_msgb: Header[8] [Cookie] =3D=20 [JSESSIONID=3D4ACF4EDC4DCBC6253DE8F810598F0771; = SCREEN_NAME=3DiscdwJTOWtk=3D;=20 LOGIN=3Dtest@liferay.com; COOKIE_SUPPORT=3Dtrue; = GUEST_LANGUAGE_ID=3Dfi_FI] [Thu Dec 06 22:25:35 2007] [debug] ajp_header.c(284):=20 ajp_marshal_into_msgb: Header[9] [Cache-Control] =3D [max-age=3D0] [Thu Dec 06 22:25:35 2007] [debug] ajp_header.c(284):=20 ajp_marshal_into_msgb: Header[10] [Max-Forwards] =3D [10] [Thu Dec 06 22:25:35 2007] [debug] ajp_header.c(424):=20 ajp_marshal_into_msgb: Done [Thu Dec 06 22:25:35 2007] [debug] mod_proxy_ajp.c(188): proxy:=20 APR_BUCKET_IS_EOS [Thu Dec 06 22:25:35 2007] [debug] mod_proxy_ajp.c(193): proxy: data to=20 read (max 8186 at 4) [Thu Dec 06 22:25:35 2007] [debug] mod_proxy_ajp.c(208): proxy: got 0=20 bytes of data [Thu Dec 06 22:25:35 2007] [debug] ajp_header.c(643): ajp_read_header:=20 ajp_ilink_received 04 [Thu Dec 06 22:25:35 2007] [debug] ajp_header.c(653): ajp_parse_type: = got 04 [Thu Dec 06 22:25:35 2007] [debug] ajp_header.c(484):=20 ajp_unmarshal_response: status =3D 200 [Thu Dec 06 22:25:35 2007] [debug] ajp_header.c(495):=20 ajp_unmarshal_response: Number of headers is =3D 4 [Thu Dec 06 22:25:35 2007] [debug] ajp_header.c(557):=20 ajp_unmarshal_response: Header[0] [Expires] =3D [Fri, 7 Dec 2007 = 14:19:41 GMT] [Thu Dec 06 22:25:35 2007] [debug] ajp_header.c(557):=20 ajp_unmarshal_response: Header[1] [Cache-Control] =3D [max-age=3D3600] [Thu Dec 06 22:25:35 2007] [debug] ajp_header.c(557):=20 ajp_unmarshal_response: Header[2] [Content-Type] =3D = [text/html;charset=3DUTF-8] [Thu Dec 06 22:25:35 2007] [debug] ajp_header.c(567):=20 ajp_unmarshal_response: ap_set_content_type done [Thu Dec 06 22:25:35 2007] [debug] ajp_header.c(557):=20 ajp_unmarshal_response: Header[3] [Content-Length] =3D [341] ... --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server = Project. See for more info. To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org " from the digest: users-digest-unsubscribe@httpd.apache.org For additional commands, e-mail: users-help@httpd.apache.org --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See for more info. To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org " from the digest: users-digest-unsubscribe@httpd.apache.org For additional commands, e-mail: users-help@httpd.apache.org