You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@trafficserver.apache.org by shekhar <sh...@aol.in> on 2012/12/05 08:37:27 UTC

Header and Transformation

Hello All,


I am new to ATS, wrote small plugin for ATS,
 


My Configuration is:


Client --->  ATS  ---> Origin Server


I want to edit Origin Server Response along with Header. 


(In case of Header, irrespective of MAX Age set by Origin Server, I want to send 'Cache-Control" parameter as a "No-Cache").


I am using remap to forward incoming client request to Origin Server and 
Sending back response of Origin server to Client.
I facing problem here, I am using transformation to edit Origin Server response and forwarding it to Client, when I edit (Origin Server Response) Header with "No-Cache", ATS does not Cache Request.


I have few questions:


1. In Event READ_RESPONSE, I am hooking in transformation for HTTP Response Edit, which is working fine.
    However, it does not go to SEND_RESPONSE after this, is it problem in my code or it has been designed this way?


2. Can I edit Client Request Header in  READ_RESPONSE event, 
I observed I can edit Server Response Header in this event and which is going to client but 
parameters like Cache-Control, In my case I am editing it to "No-Cache" and ATS does not cache this request, is it correct behavior?


3. Is it anyway possible to use transformation to edit HTTP response and edit Client Request Header as well for same request?




Thank you & Regards,

shekhar
shekhark@aol.in





Re: Header and Transformation

Posted by James Peach <jp...@apache.org>.
On 04/12/2012, at 11:37 PM, shekhar <sh...@aol.in> wrote:

> 
> Hello All,
> 
> I am new to ATS, wrote small plugin for ATS,
>  
> 
> My Configuration is:
> 
> Client --->  ATS  ---> Origin Server
> 
> I want to edit Origin Server Response along with Header. 
> 
> (In case of Header, irrespective of MAX Age set by Origin Server, I want to send 'Cache-Control" parameter as a "No-Cache").
> 
> I am using remap to forward incoming client request to Origin Server and 
> Sending back response of Origin server to Client.
> I facing problem here, I am using transformation to edit Origin Server response and forwarding it to Client, when I edit (Origin Server Response) Header with "No-Cache", ATS does not Cache Request.

In that case, I think that you need to edit the ATS response, not the Origin response.

> 
> I have few questions:
> 
> 1. In Event READ_RESPONSE, I am hooking in transformation for HTTP Response Edit, which is working fine.
>     However, it does not go to SEND_RESPONSE after this, is it problem in my code or it has been designed this way?
> 
> 2. Can I edit Client Request Header in  READ_RESPONSE event, 
> I observed I can edit Server Response Header in this event and which is going to client but 
> parameters like Cache-Control, In my case I am editing it to "No-Cache" and ATS does not cache this request, is it correct behavior?
> 
> 3. Is it anyway possible to use transformation to edit HTTP response and edit Client Request Header as well for same request?
> 
> 
> Thank you & Regards,
> shekhar
> shekhark@aol.in
> 
>