> 
> The client thus requests this javascript from the CDN.
> 
> The CDN looks in their cache if they have it.
> If they do, they serve it.
> If not, they issue a request to your site for it, and your site
> delivers
> it to the CDN.  The CDN anyway delivers it to the client.
> If the response of your site to the CDN is not chunked, they cache it,
> otherwise they don't.
> 

And has the a content-length header, but essentially, yes, all true.

> Presumably, you know when a request for such a javascript comes from
> the
> CDN (as opposed to from a client directly), and you know exactly what
> such a request looks like (I mean, there is pattern to these URLs).
> 

True

> Since you are mentioning mod_jk, I also presume that the CDN sends its
> request to an Apache httpd front-end on your site, which in turn
> proxies
> it to Tomcat via mod_jk.
> And it seems to be AJP/mod_jk which (sometimes) chunks the content
> prior
> to returning it to Apache.

True, obviously we're assuming AJP/mod_jk is doing the chunking, which Rainer 
could confirm or disconfirm.

> 
> It seems to me that in such a case, one should be able to do something
> at your Apache httpd front-end level, to "de-chunk" this response and
> re-create a content-length header, prior to returning it to the CDN.
> (As per your earlier message, we're not talking about megabyte
> responses, we're talking about 20 Kb or so).
> 

That'd be ideal, yes. I haven't found any such parameters in Apache so far 
though.
Hence the idea about downgrading to http 1.0. But that doesn't get me the 
content length header still (which in itself is strange), though I could 
(although I'm sure to get yelled at for) fake the content-length header with 
something in apache like: Header add Content-length "50000"
Where 50000 is some number larger than my largest possible response. Again, 
probably not the greatest idea.

> Maybe Apache httpd could even cache it, which I guess may ensure that
> it
> is returned non-chunked to the CDN.

I in fact, do use mod_mem_cache to cache this data (in production). For the 
purposes of testing, I have it turned off in dev.

-Tony

> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to