You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Geoff Millikan <gm...@t1shopper.com> on 2011/04/12 19:55:33 UTC

[users@httpd] mod_disk_cache doesn't cache URLs ending with a forward slash?

Dear List,

This is cached by mod_disk_cache:
http://www.t1shopper.com/mod_disk_cache_bug/index.php

This isn't cached:
http://www.t1shopper.com/mod_disk_cache_bug/

Anyone know what might cause this?

Thanks,

Geoff

---= Log showing page being written to host's cache =--- 
mod_cache.c(131): Adding CACHE_SAVE filter for /mod_disk_cache_bug/index.php 
mod_cache.c(138): Adding CACHE_REMOVE_URL filter for /mod_disk_cache_bug/index.php 
mod_deflate.c(602): Zlib: Compressed 19 to 21 : URL /mod_disk_cache_bug/index.php
mod_headers.c(663): headers: ap_headers_output_filter() 
mod_cache.c(639): cache: Caching url: /mod_disk_cache_bug/index.php 
mod_cache.c(645): cache: Removing CACHE_REMOVE_URL filter.
mod_disk_cache.c(962): disk_cache: Stored headers for URL http://www.t1shopper.com:80/mod_disk_cache_bug/index.php?
mod_disk_cache.c(1051): disk_cache: Body for URL http://www.t1shopper.com:80/mod_disk_cache_bug/index.php? cached.

---= Log showing page served from host cache to client =---
mod_disk_cache.c(476): disk_cache: Recalled cached URL info header http://www.t1shopper.com:80/mod_disk_cache_bug/index.php?
mod_disk_cache.c(749): disk_cache: Recalled headers for URL http://www.t1shopper.com:80/mod_disk_cache_bug/index.php?
mod_cache.c(282): cache: running CACHE_OUT filter 
mod_cache.c(296): cache: serving /mod_disk_cache_bug/index.php


---= Log showing "forward slash page" not served to client =--- 
mod_cache.c(131): Adding CACHE_SAVE filter for /mod_disk_cache_bug/ 
mod_cache.c(138): Adding CACHE_REMOVE_URL filter for /mod_disk_cache_bug/ 
mod_deflate.c(602): Zlib: Compressed 19 to 21 : URL /mod_disk_cache_bug/index.php

We're on:
httpd-2.2.3-45.el5.centos.x86_64.rpm


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


[users@httpd] mod_expires > Stop setting the Age header?

Posted by Geoff Millikan <gm...@t1shopper.com>.
After researching let me write note to self: Apache doesn't let me unset the Age header using "Header unset Age" as a global config
because even though it would appear to be waste of overhead to calculate it, and a waste of bandwidth to send it, RFC2616 requires
it because I'm using mod_disk_cache.

"An HTTP/1.1 server that includes a cache MUST include an Age header field in every response generated from its own cache."
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.6 

Good work Apache for enforcing the spec!

Thanks,

http://www.t1shopper.com/



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] XHTML > Set Content-Type as "application/xhtml+xml" for browsers that support it otherwise degrade to "text/html"

Posted by Geoff Millikan <gm...@t1shopper.com>.
>Is the best way to do this like: 
> AddDefaultCharset text/html
> SetEnvIfNoCase Accept "xhtml" ua_supports_xhtml=1
> Header set Content-Type "application/xhtml+xml" env=ua_supports_xhtml

Not sure if above method is "best" but we tested and it "works" but since we're using mod_cache it doesn't work.  Why?  Because the
first time the page is requested it's cached.  And the cached version contains randomly either "application/xhtml+xml" or
"text/html."  So everyone other than the first requestor is going to get the cached version - which may or may not match the request
header parameters. 

W3C has a nice write up on this issue at link below and they even say they are using one of the techniques (using mod_negotiation)
however it doesn't seem to be working because when I request a page from W3C sending in an Accept header of
"text/html,application/xhtml+xml,application/xml..." I get back headers of "Content-Type text/html..." instead of the expected
"application/xhtml+xml."

http://www.w3.org/2003/01/xhtml-mimetype/content-negotiation

The latest mod_negotiation module might circumvent whatever issue W3C appears to be having and/or the above mod_cache issue per link
below but it's a bit vague:
http://httpd.apache.org/docs/current/content-negotiation.html#caching

Anyway, I think we're going to have to scrap using XHTML.

Thanks,

http://www.t1shopper.com/ 
 


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] XHTML > Set Content-Type as "application/xhtml+xml" for browsers that support it otherwise degrade to "text/html"

Posted by Nick Kew <ni...@webthing.com>.
On 2 May 2011, at 19:26, Geoff Millikan wrote:

> PS. We'd consider using mod_negotiation to do this but we'd prefer not to make a HTML and XHTML of the same page.  We're just going
> to make one XHTML document and send it to everyone. The browsers that don't support XHTML will just have to do their best.

You should be able to do that with mod_negotiation.  Same file, different headers.

> PPS. The recommended Content-Type for XHTML documents (which despite mixed support, is W3C's recommended language for mobile
> browsers: http://www.w3.org/TR/mobile-bp/#ddc ) is "application/xhtml+xml" but it's permitted to be "text/html." 

That'll be XHTML 1.0, Appendix C.  Or something cloned from it.
A rich source of confusion.

-- 
Nick Kew

Available for work, contract or permanent
http://www.webthing.com/~nick/cv.html


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


[users@httpd] XHTML > Set Content-Type as "application/xhtml+xml" for browsers that support it otherwise degrade to "text/html"

Posted by Geoff Millikan <gm...@t1shopper.com>.
Dear List,

For the browsers that support XHTML we'll set the Content-Type as "application/xhtml+xml" otherwise we'll send the same XHTML
document as Content-Type "text/html."  Is the best way to do this like: 

AddDefaultCharset text/html
SetEnvIfNoCase Accept "xhtml" ua_supports_xhtml=1
Header set Content-Type "application/xhtml+xml" env=ua_supports_xhtml

Thanks,

http://www.t1shopper.com/ 

PS. We'd consider using mod_negotiation to do this but we'd prefer not to make a HTML and XHTML of the same page.  We're just going
to make one XHTML document and send it to everyone. The browsers that don't support XHTML will just have to do their best.

PPS. The recommended Content-Type for XHTML documents (which despite mixed support, is W3C's recommended language for mobile
browsers: http://www.w3.org/TR/mobile-bp/#ddc ) is "application/xhtml+xml" but it's permitted to be "text/html."  

http://www.w3.org/TR/2009/NOTE-xhtml-media-types-20090116/#text-html





---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] mod_disk_cache doesn't cache URLs ending with a forward slash?

Posted by Geoff Millikan <gm...@t1shopper.com>.
> fwliw, I've looked before and it is "on purpose" that those requests
> aren't cached; I don't recall the exact reason

I saw something about some caching issues where
http://www.t1shopper.com

was getting properly 301 redirected to
http://www.t1shopper.com/

but mod_cache was doing something odd with caching the redirect instead of the destination page but this is different.

If you think of some reason this should not be cached, pray tell.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod_disk_cache doesn't cache URLs ending with a forward slash?

Posted by Jeff Trawick <tr...@gmail.com>.
On Wed, Apr 13, 2011 at 2:47 PM, Geoff Millikan <gm...@t1shopper.com> wrote:
> Do we give out t-shirts or coffee mugs if someone stumps the list?   ;-)

fwliw, I've looked before and it is "on purpose" that those requests
aren't cached; I don't recall the exact reason

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] mod_disk_cache doesn't cache URLs ending with a forward slash?

Posted by Geoff Millikan <gm...@t1shopper.com>.
To close this out:  The symptoms as described in this thread and submitted as a bug at
https://issues.apache.org/bugzilla/show_bug.cgi?id=51057

just point to the real issue which is with mod_dir (DirectoryIndex) and is already a known bug but the way it was written up, I
don't believe the scope of the issue was known.  I've updated the parent ticket:
https://issues.apache.org/bugzilla/show_bug.cgi?id=45273

I searched and found no patches submitted for this bug at the time of this writing.

Thanks list! 


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod_disk_cache doesn't cache URLs ending with a forward slash?

Posted by Jeff Trawick <tr...@gmail.com>.
On Wed, Apr 13, 2011 at 5:11 PM, Geoff Millikan <gm...@t1shopper.com> wrote:
>> Patches welcome.
>
> My skill at cheeky comments exceeds that of my Apache dev skills which isn't saying much.
>
>> Or if there's already a patch but it's languishing
>> unloved, give us a friendly prod on the dev list!
>
> Searched below for info on patches with no success.  Where does one find patches?

submitted patches are either posted to the dev@httpd.apache.org
mailing list or attached to bug reports
(http://issues.apache.org/bugzilla)

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] mod_disk_cache doesn't cache URLs ending with a forward slash?

Posted by Geoff Millikan <gm...@t1shopper.com>.
> Patches welcome.

My skill at cheeky comments exceeds that of my Apache dev skills which isn't saying much.
 
> Or if there's already a patch but it's languishing
> unloved, give us a friendly prod on the dev list!

Searched below for info on patches with no success.  Where does one find patches?  

http://httpd.apache.org/dev/patches.html

http://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x/modules/cache/



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod_disk_cache doesn't cache URLs ending with a forward slash?

Posted by Nick Kew <ni...@webthing.com>.
On 13 Apr 2011, at 19:47, Geoff Millikan wrote:

> Do we give out t-shirts or coffee mugs if someone stumps the list?   ;-)

No, you get your ear clipped for bloomin' cheek!

Seriously though, you seem to be doing the right thing[1] by addressing
this in bugzilla, where I see you've added comments to some related
bug reports and entered a new one.  That means it's there next time
someone devotes time&effort to fixing mod_cache.

Patches welcome.  Or if there's already a patch but it's languishing
unloved, give us a friendly prod on the dev list!

[1] assuming you're right in what you tell us!

-- 
Nick Kew

Available for work, contract or permanent
http://www.webthing.com/~nick/cv.html


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] mod_disk_cache doesn't cache URLs ending with a forward slash?

Posted by Geoff Millikan <gm...@t1shopper.com>.
Do we give out t-shirts or coffee mugs if someone stumps the list?   ;-)


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org