You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by mi...@asipay.com on 2010/06/08 02:05:49 UTC

[users@httpd] Unable to conditionally set cache-control

Please excuse my query as I'm new to apache and open source in general.
I'm attempting to set the cache-control to no-cache by using the
following statements within my httpd.conf:

 

<FilesMatch "\.(html|htm|js|css)$">

Header unset ETag

Header set Cache-Control "max-age=0, no-cache, no-store,
must-revalidate"

Header set Pragma "no-cache"

Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT"

</FilesMatch>

 

When I use the configuration above, I get the following unexpected
response (home.html page):

 

HTTP/1.1 200 OK

Date: Mon, 07 Jun 2010 23:35:14 GMT

Server: Apache/2.2.3 (Red Hat)

Connection: close

Transfer-Encoding: chunked

Content-Type: text/html; charset=UTF-8

 

If I remove the 'FilesMatch' conditional statement and use the
following::

 

Header unset ETag

Header set Cache-Control "max-age=0, no-cache, no-store,
must-revalidate"

Header set Pragma "no-cache"

Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT"

 

I then get the expected results on the response (home.html page):

 

HTTP/1.1 200 OK

Date: Mon, 07 Jun 2010 23:43:04 GMT

Server: Apache/2.2.3 (Red Hat)

Cache-Control: max-age=0, no-cache, no-store, must-revalidate

Pragma: no-cache

Expires: Wed, 11 Jan 1984 05:00:00 GMT

Connection: close

Transfer-Encoding: chunked

Content-Type: text/html; charset=UTF-8

 

I have not been able to get the conditional 'FilesMatch' statement to
work.  Any ideas what I may be doing wrong or may be missing?  Thanks in
advance for your help.

 

MJC

 

 

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Notice: This information is intended only for the person(s) or entity(ies) to which it is addressed. This information may contain information that is confidential or otherwise protected from disclosure. If you are not the intended recipient of this message, or if this message has been addressed to you in error, please immediately alert the sender by reply e-mail and then delete this message, including any attachments. Any dissemination, distribution or other use of the contents of this message by anyone other than the intended recipient is strictly prohibited.

Re: [users@httpd] Unable to conditionally set cache-control

Posted by Eric Covener <co...@gmail.com>.
On Tue, Jun 8, 2010 at 3:20 PM, <mi...@asipay.com> wrote:
>
> The home.html is a JSP page written by tomcat.
>
> Yes, the problem is the same for all file types.


<Files> and <Directory> refer to things in the Apache filesystem, not
to patterns in a URL.  Try LocationMatch.

--
Eric Covener
covener@gmail.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] Unable to conditionally set cache-control

Posted by mi...@asipay.com.
The home.html is a JSP page written by tomcat.

Yes, the problem is the same for all file types.

 

To test that it is indeed all file types, I modified the conditional
statement to include *.jpg with same results:

<FilesMatch "\.(html|htm|js|css|jpg)$">
Header unset ETag
Header set Cache-Control "max-age=0, no-cache, no-store,
must-revalidate"
Header set Pragma "no-cache"
Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT"
</FilesMatch>

 With the following results:

 

https://10.35.0.2/asipay/images/asi_logo.jpg

 

.....

 

HTTP/1.1 200 OK

Date: Tue, 08 Jun 2010 18:57:45 GMT

Server: Apache/2.2.3 (Red Hat)

Etag: W/"19350-1274219366000"

Last-Modified: Tue, 18 May 2010 21:49:26 GMT

Content-Length: 19350

Connection: close

Content-Type: image/jpeg

________________________________

 

Is the home.html an actual file or a Rewrite rule ?
Do you have the same problem with other files ? .js or .css ?

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Notice: This information is intended only for the person(s) or entity(ies) to which it is addressed. This information may contain information that is confidential or otherwise protected from disclosure. If you are not the intended recipient of this message, or if this message has been addressed to you in error, please immediately alert the sender by reply e-mail and then delete this message, including any attachments. Any dissemination, distribution or other use of the contents of this message by anyone other than the intended recipient is strictly prohibited.

Re: [users@httpd] Unable to conditionally set cache-control

Posted by Pablo Garcia Melga <ma...@gmail.com>.
Is the home.html an actual file or a Rewrite rule ?
Do you have the same problem with other files ? .js or .css ?

On Mon, Jun 7, 2010 at 9:05 PM, <mi...@asipay.com> wrote:

>  Please excuse my query as I’m new to apache and open source in general.
> I’m attempting to set the cache-control to no-cache by using the following
> statements within my httpd.conf:
>
>
>
> <FilesMatch "\.(html|htm|js|css)$">
>
> Header unset ETag
>
> Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
>
> Header set Pragma "no-cache"
>
> Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT"
>
> </FilesMatch>
>
>
>
> When I use the configuration above, I get the following unexpected response
> (home.html page):
>
>
>
> HTTP/1.1 200 OK
>
> Date: Mon, 07 Jun 2010 23:35:14 GMT
>
> Server: Apache/2.2.3 (Red Hat)
>
> Connection: close
>
> Transfer-Encoding: chunked
>
> Content-Type: text/html; charset=UTF-8
>
>
>
> If I remove the ‘FilesMatch’ conditional statement and use the following::
>
>
>
> Header unset ETag
>
> Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
>
> Header set Pragma "no-cache"
>
> Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT"
>
>
>
> I then get the expected results on the response (home.html page):
>
>
>
> HTTP/1.1 200 OK
>
> Date: Mon, 07 Jun 2010 23:43:04 GMT
>
> Server: Apache/2.2.3 (Red Hat)
>
> Cache-Control: max-age=0, no-cache, no-store, must-revalidate
>
> Pragma: no-cache
>
> Expires: Wed, 11 Jan 1984 05:00:00 GMT
>
> Connection: close
>
> Transfer-Encoding: chunked
>
> Content-Type: text/html; charset=UTF-8
>
>
>
> I have not been able to get the conditional ‘FilesMatch’ statement to
> work.  Any ideas what I may be doing wrong or may be missing?  Thanks in
> advance for your help.
>
>
>
> MJC
>
>
>
>
>
>
>
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>
>
> Notice: This information is intended only for the person(s) or entity(ies) to which it is addressed. This information may contain information that is confidential or otherwise protected from disclosure. If you are not the intended recipient of this message, or if this message has been addressed to you in error, please immediately alert the sender by reply e-mail and then delete this message, including any attachments. Any dissemination, distribution or other use of the contents of this message by anyone other than the intended recipient is strictly prohibited.
>