You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by ye...@yemtech.com on 2004/08/31 19:47:27 UTC

How do I get an intermediary proxy from caching?

Hello all,
I have taken a cursory look at the documentation for tomcat 5.x and I
could not see how to get intermediary proxy's from caching my web page.  I
have the tags:
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<META HTTP-EQUIV="Expires" CONTENT="Wed, 01 Sep 2004 17:52:51 GMT">

in my head section, but the proxy still caches my page.  I read somewhere
to put the cache-control:no-cache in the http header of the request, but I
could not find how to do this in tomcat.  Any help would be appreciated.

-- 
Christopher Cullum
ccullum@yemtech.com





---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: How do I get an intermediary proxy from caching?

Posted by ye...@yemtech.com.
-- 
Christopher Cullum
ccullum@yemtech.com

Carl Howells said:
> yem@yemtech.com wrote:
>> Can I ask Tomcat if it has flushed it's output buffer yet?
>>
>
> As part of the servlet spec...
>
> HttpServletResponse has an isCommitted() method.  That will tell you
> whether it's flushed the buffer.
>
> But really, it seems like a bad design to rely on that method.
To rely on that method, yes a bad design, to check before you change the
headers, so you can head off an exception, not a bad design.

>
> --------------------------------------------------------------------- To
> unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For
> additional commands, e-mail: tomcat-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: How do I get an intermediary proxy from caching?

Posted by Carl Howells <ch...@janrain.com>.
yem@yemtech.com wrote:
> Can I ask Tomcat if it has flushed it's output buffer yet?
> 

As part of the servlet spec...

HttpServletResponse has an isCommitted() method.  That will tell you 
whether it's flushed the buffer.

But really, it seems like a bad design to rely on that method.

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: How do I get an intermediary proxy from caching?

Posted by ye...@yemtech.com.
Can I ask Tomcat if it has flushed it's output buffer yet?

-- 
Christopher Cullum
ccullum@yemtech.com

John Villar said:
> you could also use a filter for your whole app that does that, if you
> want all your app "non-cached", same rules apply....
>
> Ronald Klop escribió:
>
>> Yes. To be precise: you have to set the headers before Tomcat flushes
>> its outputbuffer for the first time. To be save, just set headers,
>> than output html.
>>
>> Ronald,
>>
>> On Tue Aug 31 20:10:13 CEST 2004 "yem@yemtech.com" <ye...@yemtech.com>
>> wrote:
>>
>>> Must you do this as one of the first things you do, before you output
>>>  any
>>> html?
>>>
>>> --
>>> Christopher Cullum
>>> ccullum@yemtech.com
>>>
>>> John Gentilin said:
>>> >When I am battling against IE caching or proxy caching, I add the
>>> following lines
>>> >to my response header. A bit brute force but it seems to work,
>>> althought
>>> >I think
>>> >it cause some issues when backing up on a form, forcing a reload.
>>> >
>>> >response.setHeader("Cache-Control",
>>> >"no-cache,max-age=0,must-revalidate");
>>> >response.setHeader("Pragma", "no-cache");
>>> >response.setHeader("Expires", "-1d");
>>> >
>>> >yem@yemtech.com wrote:
>>> >
>>> >>Hello all,
>>> >>I have taken a cursory look at the documentation for tomcat 5.x and
>>> I could not see how to get intermediary proxy's from caching my web
>>>
>>> page.
>>> >>I have the tags:
>>> >><meta http-equiv="pragma" content="no-cache">
>>> >><meta http-equiv="cache-control" content="no-cache">
>>> >><META HTTP-EQUIV="Expires" CONTENT="Wed, 01 Sep 2004 17:52:51 GMT">
>>> >>
>>> >>in my head section, but the proxy still caches my page. I read
>>> somewhere to put the cache-control:no-cache in the http header of
>>> the request, but I could not find how to do this in tomcat. Any
>>> help would be appreciated.
>>> >>
>>> >>
>>> >>
>>> >
>>> >
>>> >
>>> >---------------------------------------------------------------------
>>>
>>> To
>>> >unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For
>>> additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>>
>>
>>
>
> --
> John Villar
> Gerente de Proyectos
> Computadores Flor Hard Soft 2058 C.A.
> www.florhard.com




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: How do I get an intermediary proxy from caching?

Posted by John Villar <jo...@florhard.com>.
you could also use a filter for your whole app that does that, if you 
want all your app "non-cached", same rules apply....

Ronald Klop escribió:

> Yes. To be precise: you have to set the headers before Tomcat flushes 
> its outputbuffer for the first time. To be save, just set headers, 
> than output html.
>
> Ronald,
>
> On Tue Aug 31 20:10:13 CEST 2004 "yem@yemtech.com" <ye...@yemtech.com> 
> wrote:
>
>> Must you do this as one of the first things you do, before you output 
>> any
>> html?
>>
>> -- 
>> Christopher Cullum
>> ccullum@yemtech.com
>>
>> John Gentilin said:
>> >When I am battling against IE caching or proxy caching, I add the
>> >following lines
>> >to my response header. A bit brute force but it seems to work, 
>> althought
>> >I think
>> >it cause some issues when backing up on a form, forcing a reload.
>> >
>> >response.setHeader("Cache-Control",
>> >"no-cache,max-age=0,must-revalidate");
>> >response.setHeader("Pragma", "no-cache");
>> >response.setHeader("Expires", "-1d");
>> >
>> >yem@yemtech.com wrote:
>> >
>> >>Hello all,
>> >>I have taken a cursory look at the documentation for tomcat 5.x and I
>> >>could not see how to get intermediary proxy's from caching my web 
>> page.
>> >>I have the tags:
>> >><meta http-equiv="pragma" content="no-cache">
>> >><meta http-equiv="cache-control" content="no-cache">
>> >><META HTTP-EQUIV="Expires" CONTENT="Wed, 01 Sep 2004 17:52:51 GMT">
>> >>
>> >>in my head section, but the proxy still caches my page. I read
>> >>somewhere to put the cache-control:no-cache in the http header of the
>> >>request, but I could not find how to do this in tomcat. Any help would
>> >>be appreciated.
>> >>
>> >>
>> >>
>> >
>> >
>> >
>> >--------------------------------------------------------------------- 
>> To
>> >unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For
>> >additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>
>
>

-- 
John Villar
Gerente de Proyectos
Computadores Flor Hard Soft 2058 C.A.
www.florhard.com



Re: How do I get an intermediary proxy from caching?

Posted by Ronald Klop <ro...@base.nl>.
Yes. To be precise: you have to set the headers before Tomcat flushes its outputbuffer for the first time. To be save, just set headers, than output html.

Ronald,

On Tue Aug 31 20:10:13 CEST 2004 "yem@yemtech.com" <ye...@yemtech.com> wrote:
> Must you do this as one of the first things you do, before you output any
> html?
> 
> -- 
> Christopher Cullum
> ccullum@yemtech.com
> 
> John Gentilin said:
> >When I am battling against IE caching or proxy caching, I add the
> >following lines
> >to my response header. A bit brute force but it seems to work, althought
> >I think
> >it cause some issues when backing up on a form, forcing a reload.
> >
> >response.setHeader("Cache-Control",
> >"no-cache,max-age=0,must-revalidate");
> >response.setHeader("Pragma", "no-cache");
> >response.setHeader("Expires", "-1d");
> >
> >yem@yemtech.com wrote:
> >
> >>Hello all,
> >>I have taken a cursory look at the documentation for tomcat 5.x and I
> >>could not see how to get intermediary proxy's from caching my web page.
> >>I have the tags:
> >><meta http-equiv="pragma" content="no-cache">
> >><meta http-equiv="cache-control" content="no-cache">
> >><META HTTP-EQUIV="Expires" CONTENT="Wed, 01 Sep 2004 17:52:51 GMT">
> >>
> >>in my head section, but the proxy still caches my page. I read
> >>somewhere to put the cache-control:no-cache in the http header of the
> >>request, but I could not find how to do this in tomcat. Any help would
> >>be appreciated.
> >>
> >>
> >>
> >
> >
> >
> >--------------------------------------------------------------------- To
> >unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For
> >additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 


Re: How do I get an intermediary proxy from caching?

Posted by John Gentilin <jo...@gentilin.org>.
Not sure if order matters but in my code, I set the headers first then 
process the request.
-JG

yem@yemtech.com wrote:

>Must you do this as one of the first things you do, before you output any
>html?
>
>  
>



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: How do I get an intermediary proxy from caching?

Posted by ye...@yemtech.com.
Must you do this as one of the first things you do, before you output any
html?

-- 
Christopher Cullum
ccullum@yemtech.com

John Gentilin said:
> When I am battling against IE caching or proxy caching, I add the
> following lines
> to my response header. A bit brute force but it seems to work, althought
>  I think
> it cause some issues when backing up on a form, forcing a reload.
>
>         response.setHeader("Cache-Control",
> "no-cache,max-age=0,must-revalidate");
>         response.setHeader("Pragma", "no-cache");
>         response.setHeader("Expires", "-1d");
>
> yem@yemtech.com wrote:
>
>>Hello all,
>>I have taken a cursory look at the documentation for tomcat 5.x and I
>> could not see how to get intermediary proxy's from caching my web page.
>>  I have the tags:
>>	<meta http-equiv="pragma" content="no-cache">
>>	<meta http-equiv="cache-control" content="no-cache">
>>	<META HTTP-EQUIV="Expires" CONTENT="Wed, 01 Sep 2004 17:52:51 GMT">
>>
>>in my head section, but the proxy still caches my page.  I read
>> somewhere to put the cache-control:no-cache in the http header of the
>> request, but I could not find how to do this in tomcat.  Any help would
>> be appreciated.
>>
>>
>>
>
>
>
> --------------------------------------------------------------------- To
> unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For
> additional commands, e-mail: tomcat-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: How do I get an intermediary proxy from caching?

Posted by John Gentilin <jo...@gentilin.org>.
When I am battling against IE caching or proxy caching, I add the 
following lines
to my response header. A bit brute force but it seems to work, althought 
I think
it cause some issues when backing up on a form, forcing a reload.

        response.setHeader("Cache-Control", 
"no-cache,max-age=0,must-revalidate");
        response.setHeader("Pragma", "no-cache");
        response.setHeader("Expires", "-1d");

yem@yemtech.com wrote:

>Hello all,
>I have taken a cursory look at the documentation for tomcat 5.x and I
>could not see how to get intermediary proxy's from caching my web page.  I
>have the tags:
>	<meta http-equiv="pragma" content="no-cache">
>	<meta http-equiv="cache-control" content="no-cache">
>	<META HTTP-EQUIV="Expires" CONTENT="Wed, 01 Sep 2004 17:52:51 GMT">
>
>in my head section, but the proxy still caches my page.  I read somewhere
>to put the cache-control:no-cache in the http header of the request, but I
>could not find how to do this in tomcat.  Any help would be appreciated.
>
>  
>



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: How do I get an intermediary proxy from caching?

Posted by ye...@yemtech.com.
Thanks, I will give this a try.

-- 
Christopher Cullum
ccullum@yemtech.com

QM said:
> On Tue, Aug 31, 2004 at 10:47:27AM -0700, yem@yemtech.com wrote:
> : in my head section, but the proxy still caches my page.  I read
> somewhere : to put the cache-control:no-cache in the http header of the
> request, but I : could not find how to do this in tomcat.  Any help
> would be appreciated.
>
> Response.setHeader()
>
> -QM
>
> --
>
> software  -- http://www.brandxdev.net
> tech news -- http://www.RoarNetworX.com
>
>
> --------------------------------------------------------------------- To
> unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For
> additional commands, e-mail: tomcat-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: How do I get an intermediary proxy from caching?

Posted by QM <qm...@brandxdev.net>.
On Tue, Aug 31, 2004 at 10:47:27AM -0700, yem@yemtech.com wrote:
: in my head section, but the proxy still caches my page.  I read somewhere
: to put the cache-control:no-cache in the http header of the request, but I
: could not find how to do this in tomcat.  Any help would be appreciated.

Response.setHeader()

-QM

-- 

software  -- http://www.brandxdev.net
tech news -- http://www.RoarNetworX.com


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org