logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: mod_headers, mod_rewrite & php header modification
Author
malevopfgm



Joined: 19 May 2010
Posts: 2

PostPosted: Wed 19 May '10 14:51    Post subject: mod_headers, mod_rewrite & php header modification Reply with quote

Hello Lounge, I'm struggling with a configuration that doesn't seems to work

I have configured this rewrite rule
RewriteRule "/c([0-9]+)-([a-zA-Z/-]+)-p([0-9]+)(.*)" "/nl_listado.php?categoria=$1&pagina=$3"

Works fine, no problem.
Now I want to remove all cache-related headers sent by the php and set my own.
So I put these lines in the config.

<Files nl_listado.php>
Header unset set-cookie
Header unset Expires
Header unset cache-control
Header unset Pragma
Header set cache-control "public"
Header append cache-control "max-age=1200"
</Files>
<FilesMatch "/c([0-9]+)-(.*)">
Header unset set-cookie
Header unset Expires
Header unset cache-control
Header unset Pragma
Header set cache-control "public"
Header append cache-control "max-age=1200"
</FilesMatch>

Neither of these seems to work as expected, instead I get a mixed response.

This are the response headers without the sections

Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0, no-cache
Expires: -1
Pragma: no-cache

And this are the response headers after I place the configuration on the apache

Cache-Control: public, max-age=1200, no-cache
Expires: -1
Pragma: no-cache

Any ideas ?

Regards, Pablo
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Wed 19 May '10 21:50    Post subject: Reply with quote

Is this what you are experiencing?

https://issues.apache.org/bugzilla/show_bug.cgi?id=49308
Back to top
malevopfgm



Joined: 19 May 2010
Posts: 2

PostPosted: Wed 19 May '10 22:57    Post subject: Reply with quote

Kind off,
Look at the original Headers, the Cache-Control seems to being replaced by the Header statement, but later it adds a no-cache. It might be that there are several ways to trigger this behavior.
I thought it was a misconfiguration related to the LoadModule order.

Thanks for the info, we'll see if this bugs gets corrected fast.

Regards, Pablo

BTW, do you have any idea of a workaround to this problem ?
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Wed 19 May '10 23:36    Post subject: Reply with quote

No, sorry I do not.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Sun 23 May '10 16:53    Post subject: Reply with quote

The docs are updated! You could use something like always.

Code:

Header always edit Cache-control no-cache "private, max-age=0"


Also read all the comments on Bug 49308
Back to top


Reply to topic   Topic: mod_headers, mod_rewrite & php header modification View previous topic :: View next topic
Post new topic   Forum Index -> Apache