Re: response headers missing ?
Rainer Jung wrote: On 14.07.2011 12:29, André Warnier wrote: Hi. This is a bit of a side question, or let's say a question-by-proxy. I happen to be also subscribed to a support list for mod_perl, and someone there made the following comment as part of a post : quote We have 100+ web servers where apache fronts a separate tomcat server using mod_proxy. Sadly, the tomcat dev's forgot to set any caching headers in the HTTP response (either Expires, Last-Modified or Cache-control) so the sites are largely uncacheable by browsers and the various tomcats are becoming overloaded. unquote Do any of the dev's here have a comment to make ? Yes, go for TC 7: http://tomcat.apache.org/tomcat-7.0-doc/config/filter.html#Expires_Filter Genial, Rainer. That looks exactly like what the mod_perl OP was looking for. Even the reference to the Apache mod_expires will help him, I think. Thanks. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: response headers missing ?
On 14.07.2011 12:29, André Warnier wrote: > Hi. > > This is a bit of a side question, or let's say a question-by-proxy. > > I happen to be also subscribed to a support list for mod_perl, and > someone there made the following comment as part of a post : > > quote > > We have 100+ web servers where apache fronts a separate tomcat server > using mod_proxy. > > Sadly, the tomcat dev's forgot to set any caching headers in the HTTP > response (either Expires, Last-Modified or Cache-control) so the sites > are largely uncacheable by browsers and the various tomcats are becoming > overloaded. > > unquote > > Do any of the dev's here have a comment to make ? Yes, go for TC 7: http://tomcat.apache.org/tomcat-7.0-doc/config/filter.html#Expires_Filter Regards, Rainer - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: response headers missing ?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 André, On 7/14/2011 7:25 AM, André Warnier wrote: > quote [...] I would also add that most of the sites are "dynamically" > driven pages, even involving MySQL querying, but once launched, the > data remains fairly static - eg GET X will always resolve to reponse > Y. > > [...] > > I think for this problem, I have to treat tomcat as a little, rather > inefficient, black box and try to fixup on the apache front ends, > hence the direction of my original idea... > > unquote > > One interesting suggestion here was to use the URLRewriteFilter. I > will pass that on to the mod_perl OP. If the OP is willing to get into the Java world, it might be easier to write a simpler filter, since I think URLRewriteFilter expects to, you know, re-write the request and not just add headers. If "GET X" always returns "response Y", then a simple use of mod_headers ought to do the trick with no mucking-around in Java. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk4e/2MACgkQ9CaO5/Lv0PD1zACgtXolM2lOnqrhvkIK78eGw1rV d6sAoJfqDk53cBVyDQ2tTXJlqbui7GNz =Fxm3 -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: response headers missing ?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Pid, On 7/14/2011 6:37 AM, Pid wrote: > I'd ask the OP to back that up with an explanation and some proof, > contrary to the below: Can you clarify this? It looks like request and response headers jumbled together. > Request URL:http://localhost:8081/tomcat.png Request Method:GET > Status Code:304 Not Modified ^^^ Looks like start of response. > Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 > > Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3 > Accept-Encoding:gzip,deflate,sdch Accept-Language:en-US,en;q=0.8 > Cache-Control:max-age=0 Connection:keep-alive Host:localhost:8081 > If-Modified-Since:Sat, 02 Jul 2011 21:38:58 GMT > If-None-Match:W/"5103-1309642738000" User-Agent:Mozilla/5.0 > (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.1 (KHTML, like > Gecko) Chrome/14.0.803.0 Safari/535.1 ^^^ Definitely client headers. > Date:Thu, 14 Jul 2011 10:35:31 GMT ETag:W/"5103-1309642738000" > Server:Apache-Coyote/1.1 ^^^ Definitely response headers. Neither Expires nor Last-Modified nor Cache-Control appear in the response headers, which was the original complaint. One could argue that Etag is a proxy/replacement for Expires and Last-Modified. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk4e/fsACgkQ9CaO5/Lv0PD+ogCdEaesU28FzNXO2EIvrc6PnHYk Ly0AnAgOuc5FijuNHjgiwMZ+M6r/g4wb =LeW+ -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: response headers missing ?
Am 14.07.2011 13:25, schrieb André Warnier: Mark Thomas wrote: On 14/07/2011 11:29, André Warnier wrote: Hi. This is a bit of a side question, or let's say a question-by-proxy. ... I think for this problem, I have to treat tomcat as a little, rather inefficient, black box and try to fixup on the apache front ends, hence the direction of my original idea... If you have no chance to get these applications fixed - keep it this way. Treat the tomcat as black box and add cache-control headers on the apache-frontend where possible. Use Location(Match) and mod_headers to append whatever is needed to the server response to make it browser-cachable Stefan - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: response headers missing ?
Mark Thomas wrote: On 14/07/2011 11:29, André Warnier wrote: Hi. This is a bit of a side question, or let's say a question-by-proxy. I happen to be also subscribed to a support list for mod_perl, and someone there made the following comment as part of a post : quote We have 100+ web servers where apache fronts a separate tomcat server using mod_proxy. Sadly, the tomcat dev's forgot to set any caching headers in the HTTP response (either Expires, Last-Modified or Cache-control) so the sites are largely uncacheable by browsers and the various tomcats are becoming overloaded. unquote Do any of the dev's here have a comment to make ? "Sadly, the mod_perl OP forget to do any research (such as requesting Tomcat's homepage and reading the headers) so my response is largely unprintable in polite society and the various Tomcat devs are becoming under impressed." Wooaw. It was not my intention to start an inter-Apache-list war here, so I have a couple of things to add : 1) reading the next post of the original mod_perl poster, it has become clear to me that what he meant by "the tomcat dev's" was not "The Tomcat Dev's". He obviously meant "the dev's who developed the applications running under Tomcat". And he was not talking about static pages, it is more complicated than that. So you can all get back to being your usual serene and competent helpful selves again. 2) to further dispel the issue, here is the second post by the same OP. (I also have to add that I am quoting all this without permission, and it was just by curiosity). quote ... > Assuming that what you say about Tomcat is true (I don't know, and it > may be worth asking this on the Tomcat list), I can think of another way > to achieve what you seem to want : > if you can distinguish, from the request URL (or any other request > property), the requests that are for invariant things, then you could > arrange to /not/ proxy these requests to Tomcat, and serve them directly > from Apache httpd. Indeed that is a good idea. We are doing that for new projects for css and js files (apache does not proxy certain paths and picks these up from the local filesystem). We can't do that for the 100 odd legacy servers as no-one has time o delve into the java/JSP code. I need to do something "outside" of tomcat where possible. Just to explain, each web server is a paid-for project - and when it's done, it sits there for 5+ years. Only I have the time/inclination to fix this as it's killing my VMWare infrastructure. Because the sites are all fronted by apache in a similar way, one solution is likely to apply to most of the sites. I would also add that most of the sites are "dynamically" driven pages, even involving MySQL querying, but once launched, the data remains fairly static - eg GET X will always resolve to reponse Y. I'm planning a small seminar on the value of Cache-Control for my dev colleagues so they can stop making this mistake ;-> But that still leaves a lot of "done" projects to fix. > Which proxying method exactly are you using between Apache and Tomcat ? > (if you are using mod_proxy, then you are either using mod_proxy_http or > mod_proxy_ajp; you could also consider using mod_jk). mod_proxy_http specifically. mod_jk looks interesting for new projects (we have local tomcats for those now) - I think it may be a non-starter for old stuff as trying to retro fit it may not be so simple (our older tomcat servers are in a remote farm on their own machines hence the use of mod_proxy_http). > Also, what are the versions of Apache and Tomcat that you are using ? > Apache 2.2 (various sub versions) and both tomcat 5.5 and tomcat 6 (but all on remote machines listening on TCP sockets). I think for this problem, I have to treat tomcat as a little, rather inefficient, black box and try to fixup on the apache front ends, hence the direction of my original idea... unquote .. and I am sure that he does not *really* mean it either, like he says in that last phrase. One interesting suggestion here was to use the URLRewriteFilter. I will pass that on to the mod_perl OP. Thanks for your answers, and peace to all. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: response headers missing ?
On 14/07/2011 11:29, André Warnier wrote: > Hi. > > This is a bit of a side question, or let's say a question-by-proxy. > > I happen to be also subscribed to a support list for mod_perl, and > someone there made the following comment as part of a post : > > quote > > We have 100+ web servers where apache fronts a separate tomcat server > using mod_proxy. > > Sadly, the tomcat dev's forgot to set any caching headers in the HTTP > response (either Expires, Last-Modified or Cache-control) so the sites > are largely uncacheable by browsers and the various tomcats are becoming > overloaded. > > unquote > > Do any of the dev's here have a comment to make ? "Sadly, the mod_perl OP forget to do any research (such as requesting Tomcat's homepage and reading the headers) so my response is largely unprintable in polite society and the various Tomcat devs are becoming under impressed." Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: response headers missing ?
On 14/07/2011 11:29, André Warnier wrote: > Hi. > > This is a bit of a side question, or let's say a question-by-proxy. > > I happen to be also subscribed to a support list for mod_perl, and > someone there made the following comment as part of a post : > > quote > > We have 100+ web servers where apache fronts a separate tomcat server > using mod_proxy. > > Sadly, the tomcat dev's forgot to set any caching headers in the HTTP > response (either Expires, Last-Modified or Cache-control) so the sites > are largely uncacheable by browsers and the various tomcats are becoming > overloaded. > > unquote I'd ask the OP to back that up with an explanation and some proof, contrary to the below: Request URL:http://localhost:8081/tomcat.png Request Method:GET Status Code:304 Not Modified Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3 Accept-Encoding:gzip,deflate,sdch Accept-Language:en-US,en;q=0.8 Cache-Control:max-age=0 Connection:keep-alive Host:localhost:8081 If-Modified-Since:Sat, 02 Jul 2011 21:38:58 GMT If-None-Match:W/"5103-1309642738000" User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.803.0 Safari/535.1 Date:Thu, 14 Jul 2011 10:35:31 GMT ETag:W/"5103-1309642738000" Server:Apache-Coyote/1.1 p > Do any of the dev's here have a comment to make ? > > (sadly, the mod_perl OP failed to provide any version information so far). signature.asc Description: OpenPGP digital signature
Re: response headers missing ?
2011/7/14 André Warnier : > Hi. > > This is a bit of a side question, or let's say a question-by-proxy. > > I happen to be also subscribed to a support list for mod_perl, and someone > there made the following comment as part of a post : > > quote > > We have 100+ web servers where apache fronts a separate tomcat server using > mod_proxy. > > Sadly, the tomcat dev's forgot to set any caching headers in the HTTP > response (either Expires, Last-Modified or Cache-control) so the sites are > largely uncacheable by browsers and the various tomcats are becoming > overloaded. > > unquote > > (sadly, the mod_perl OP failed to provide any version information so far). > AFAIK, DefaultServlet sets those headers, as well as ETag. For JSP files or Servlets adding the headers is responsibility of their authors. Well, usually JSPs and servlets have varying info and thus do not need caching (or may have some time-limited caching, like 1 minute, or 10 seconds). I think there was a filter somewhere, that can add those headers. I think UrlRewriteFilter can be set up to add them as well. Best regards, Konstantin Kolinko - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
response headers missing ?
Hi. This is a bit of a side question, or let's say a question-by-proxy. I happen to be also subscribed to a support list for mod_perl, and someone there made the following comment as part of a post : quote We have 100+ web servers where apache fronts a separate tomcat server using mod_proxy. Sadly, the tomcat dev's forgot to set any caching headers in the HTTP response (either Expires, Last-Modified or Cache-control) so the sites are largely uncacheable by browsers and the various tomcats are becoming overloaded. unquote Do any of the dev's here have a comment to make ? (sadly, the mod_perl OP failed to provide any version information so far). - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org