On Thursday 14 March 2002 04:16 pm, Chuck Esterbrook wrote: > On Wednesday 13 March 2002 10:43 am, Chuck Esterbrook wrote: > > I just looked at my apache access_log and all the requests for the > > style sheet are GET and POST. No HEAD: > > > > 68.5.28.172 - - [13/Mar/2002:13:23:12 -0500] "GET /StyleSheet.css > > HTTP/1.1" 200 10928 > > > > > > I was expecting HEAD for StyleSheet.css since it is just a static > > file being served by UnknownFileTypeServlet. > > > > A grep for HEAD reveals no more HEAD requests after March 5th. And > > the few HEADs that occurred were for anything but the StyleSheet. > > This adds 10K per request and will slow down my app server. > > Okay, the deal is that the GET from modern browsers is accompanied by > an If-Modified-Since header (so they don't bother with HEAD). I > checked this out using Mozilla, Apache and a static .html file served > directly. The requests are always GET, but the subsequent responses > return 0 bytes of document. > > Having dumped the attrs of HTTPRequest, I don't see that it has > access to that information, or even the request headers in general. I > also don't find any source code in webware referencing "modified" and > "since" in the same line. > > I presume that we can somehow get this out of mod_webkit, but I don't > know about CGI. > > I'll investigate further tonight.
Bottom line: Most browsers use a "conditional GET" such as a GET with an If-Modified-Since: header as opposed to the old "HEAD and GET" technique. However on Apache, the If-Modified-Since HTTP header does not get passed to WebKit (via mod_webkit or CGI), so for static files such as a style sheet, WebKit sends the full content every time. One workaround would be to put your static files outside your webkit location. For my special case of a style sheet, I may just may use a symbolic link that points to its current location. Here is some of the research I did (mostly via Google): - I found that some HTTP servers will offer an HTTP_IF_MODIFIED_SINCE to their CGI scripts, but Apache does not. - Searching for HTTP_IF_MODIFIED_SINCE hit a lot of PHP sites that were dumping globals, but when I visited the pages (and reloaded) HTTP_IF_MODIFIED_SINCE was missing. Perhaps it was available in an earlier version of either Apache or PHP. - The only examples of being able to hook into If-Modified-Since were things (such as mod_perl) that lived in Apache. But the hook I saw wasn't to get the value, but call a function with higher level semantics. - It might be possible to tweak Apache to include HTTP_IF_MODIFIED_SINCE, but I'm suspicious that it's not already done or at least available as a patch. There might be some special treatment of this header by Apache that make it infeasible. - Apache 2.0? -Chuck _______________________________________________ Webware-discuss mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/webware-discuss
