Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 4EC15200BC6 for ; Sun, 20 Nov 2016 14:37:03 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 4D3BC160B07; Sun, 20 Nov 2016 13:37:03 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 70C5A160AF1 for ; Sun, 20 Nov 2016 14:37:02 +0100 (CET) Received: (qmail 8400 invoked by uid 500); 20 Nov 2016 13:37:01 -0000 Mailing-List: contact users-help@trafficserver.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@trafficserver.apache.org Delivered-To: mailing list users@trafficserver.apache.org Received: (qmail 8386 invoked by uid 99); 20 Nov 2016 13:37:01 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 20 Nov 2016 13:37:01 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 1E39DC00B8 for ; Sun, 20 Nov 2016 13:37:01 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 3.689 X-Spam-Level: *** X-Spam-Status: No, score=3.689 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, KAM_BADIPHTTP=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001, T_MIME_MALF=0.01] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id CJ1Lobtv2iEN for ; Sun, 20 Nov 2016 13:36:58 +0000 (UTC) Received: from mail-oi0-f41.google.com (mail-oi0-f41.google.com [209.85.218.41]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 1A3935FCBB for ; Sun, 20 Nov 2016 13:36:58 +0000 (UTC) Received: by mail-oi0-f41.google.com with SMTP id b126so97920184oia.2 for ; Sun, 20 Nov 2016 05:36:58 -0800 (PST) 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; bh=rx5AeHGKCAKaz/yVhED6Zj3aODQvCcQXaJn/kUSHNnA=; b=QQUyhJ/nPNVFuFjf1EzcbMXKbxpBsJ1DLIo79wHXJcnrCdycUqPkVJfXLRS3VI7K/1 ZgiMyFIs0AEzPUldgH5xDWNXG+UkATWSgJiun6ScXUWc3kPWm/uMsgknsFEg+fnKRIcP MYfgEOUH98yB+3LET+ortHMFNtZHEc0NVsgxpnma60wwn0WMxDQP79kpnbdfhVppxl4B X0NsFwtHqB4o5/cbK/Gpc7OXFu2nBjPEWs+ZRHvGf4RF83DycRUZgE3MIOzuBf/l6zr5 /hoMEhrcegfvNBsuhX/u+CGNU3W4PzW0fE+G0L2YwzP0D9DPbroDz0kAp/Ey7rZFch56 KTIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=rx5AeHGKCAKaz/yVhED6Zj3aODQvCcQXaJn/kUSHNnA=; b=C6ZQMR46ZdSamypINzRdhhQFLI7VBiJC+rO8xA4VEfOxN3FSE9Wy2gNd2n/64j7x0U a+s2WgkDELhj323dhHX0QFkBLNEthnrWgFTYG03O6iZ72dcE1sRyp+7OGcW+jDyFxGg1 G5805WNm40tP5jcNfsLnhCI1D9KGEFQr8hnCe0UQxILBvyYn4EIv57rVvxdypbEvNxbo fzlUkOcfTd18ZmInCNOCzRLd8dc4XuC8VhvFXBdv6y34OOQjpVLCMl4tVe07EFDMy7fJ pslBmLNhrs8KsV4ptIrP2YvepBqHjZpNhZgh9Gf7zsAhKkt1d22T/71r7TljTyyQBUYl EPFA== X-Gm-Message-State: AKaTC029fnOW9qeot2kUud31LVnkLDKjJJoaznJ/TDISDcM1okcfu+dngHY4oeIIxc91l0SkOQDq+NKR7QlSqg== X-Received: by 10.202.186.3 with SMTP id k3mr999226oif.136.1479649012306; Sun, 20 Nov 2016 05:36:52 -0800 (PST) MIME-Version: 1.0 Received: by 10.182.106.101 with HTTP; Sun, 20 Nov 2016 05:36:51 -0800 (PST) In-Reply-To: <4D46C673-D3F6-4142-A7CD-99017EBAAD09@apache.org> References: <4D46C673-D3F6-4142-A7CD-99017EBAAD09@apache.org> From: Steve Malenfant Date: Sun, 20 Nov 2016 08:36:51 -0500 Message-ID: Subject: Re: redirect To: users@trafficserver.apache.org Content-Type: multipart/alternative; boundary=001a113cde60c57f7d0541bba17e archived-at: Sun, 20 Nov 2016 13:37:03 -0000 --001a113cde60c57f7d0541bba17e Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Also make sure proxy.config.http.cache.allow_empty_doc is enabled. Should be enabled by default. https://docs.trafficserver.apache.org/en/latest/admin-guide/files/records.c= onfig.en.html?highlight=3Dempty#proxy-config-http-cache-allow-empty-doc On Wed, Nov 16, 2016 at 10:13 PM, Bryan Call wrote: > I think it would be better to not use redirect and just use the > header_rewrite to do the redirect and set the cache-control header. Here > is an example: > > *Config:* > [bcall@homer ~]$ tail -1 /usr/local/etc/trafficserver/remap.config > #redirect http://www.google.com/ http://www.yahoo.com/ > @plugin=3Dheader_rewrite.so @pparam=3D/usr/local/etc/trafficserver/foo.co= nfig > [bcall@homer ~]$ cat /usr/local/etc/trafficserver/foo.config > set-redirect 302 http://www.yahoo.com/%{PATH} > > cond %{SEND_RESPONSE_HDR_HOOK} > rm-header Cache-Control > set-header Cache-Control "max-age=3D600, public" > > *Test:* > [bcall@homer ~]$ curl -D - -H 'Host: www.google.com' > http://127.0.0.1:8080/ > HTTP/1.1 302 Redirect > Date: Thu, 17 Nov 2016 03:13:22 GMT > Connection: keep-alive > Server: ATS/7.1.0 > Location: http://www.yahoo.com/ > Content-Type: text/html > Content-Language: en > Cache-Control: max-age=3D600, public > Content-Length: 303 > > -Bryan > > > > > On Nov 16, 2016, at 5:18 PM, Bryan Call wrote: > > I ran a test myself and I don=E2=80=99t know of a way to make the respons= e > cacheable. I assume you would like to set the Cache-Control header to > something like max-age=3D300. I will talk to a couple other Committers > tonight and see if they have any ideas. > > This is what I am seeing: > [bcall@homer ~]$ curl -D - -H 'Host: www.google.com' > http://127.0.0.1:8080/ > HTTP/1.1 301 Redirect > Date: Wed, 16 Nov 2016 08:13:03 GMT > Connection: keep-alive > Server: ATS/7.1.0 > *Cache-Control: no-store* > Location: http://www.yahoo.com/ > Content-Type: text/html > Content-Language: en > Content-Length: 303 > > -Bryan > > > > > On Nov 15, 2016, at 3:19 AM, $ubbu wrote: > > Hi everyone > > I am unable to cache the redirected urls, any way to cache the > redirected pages? > > my rule is like this > > redirect http://server1.example.com/ http://serveraz.example.com/ > > -- > *Regards* > > *Subrahmanya Prasad P* > > > > --001a113cde60c57f7d0541bba17e Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Also make sure proxy.config.http.cache.allow_empty_do= c is enabled. Should be enabled by default.

https://docs.trafficserver.apache.org/en/latest/admin-guide/files/re= cords.config.en.html?highlight=3Dempty#proxy-config-http-cache-allow-empty-= doc

On Wed, Nov 16, 2016 at 10:13 PM, Bryan Call <bcall@apache.org>= ; wrote:
I think it would be better to not use redirect and just use the = header_rewrite to do the redirect and set the cache-control header.=C2=A0 H= ere is an example:

Config:
[bcall@= homer ~]$ tail -1 /usr/local/etc/trafficserver/remap.config
= #redirect http://www.g= oogle.com/ http://w= ww.yahoo.com/ @plugin=3Dheader_rewrite.so @pparam=3D/usr/local/etc/trafficserver/foo.config
[bcall@homer ~]$ cat /usr/local/et= c/trafficserver/foo.config

cond %{SEND_RESPONSE_HDR_HOOK}
rm-h= eader Cache-Control
set-header Cache-Control "max-age=3D600,= public"

Test:
<= span class=3D"">
[bcall@homer ~]$ curl -D - -H 'Host: www.google.com' http://127.0.0.1:8080/
HTTP/1.1 302 Redirect
Date: Thu, 17 Nov 2016 03:13:22 G= MT
Connection: keep-alive
Server: ATS/7.1.0
Content-Type: text/html
Co= ntent-Language: en
Cache-Control: max-age=3D600, public
Content-Length: 303

-Bryan




On Nov 16, 2016, at 5:18 PM, Bryan = Call <bcall@apache= .org> wrote:

I ran a test myself an= d I don=E2=80=99t know of a way to make the response cacheable.=C2=A0 I ass= ume you would like to set the Cache-Control header to something like max-ag= e=3D300.=C2=A0 I will talk to a couple other Committers tonight and see if = they have any ideas.

This is what I am seeing:
[bcall@homer ~]$ curl -D - -H 'Host: www.google.com' http://127.0.0.1:8080/
HTTP/1.1 30= 1 Redirect
Date: Wed, 16 Nov 2016 08:13:03 GMT
Connecti= on: keep-alive
Server: ATS/7.1.0
Cache-Control: no-s= tore
Content-Type: text/html
Content-Language: en
Content-Length: 303

-Bryan




On Nov 15, 2016, at 3:19 AM, $ubbu = <subbu448@gmail.= com> wrote:

Hi everyone

=C2=A0= =C2=A0=C2=A0 I am unable to cache the redirected urls, any way to cache the= redirected pages?

my rule is like this

redirect http://= server1.example.com/ http://serveraz.example.com/

--
Regards
Subrahmanya Prasad P



--001a113cde60c57f7d0541bba17e--