Mailing List Archive

Static file
> I would like to know how can I control the caching behavior of the static
> files on apache. I know there is a mod_expires that I can use to append
> the expires tag in the response header. But is it enough? What about the
> cache-control tag or the no-cache pragma?
>
> Another question is, if I have specified a file to be expired in 10 days
> and that file is a symbolic link that points to another file which is
> expired in 0 sec. What will be the actual caching behavior?
>
> Thanks,
>
> --Chris

---------------------------------------------------------------------
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
For additional commands, e-mail: users-help@httpd.apache.org
RE: Static file [ In reply to ]
> From: Chris Fong [mailto:chris.fong@digeo.com]

> > I would like to know how can I control the caching behavior of
> the static
> > files on apache. I know there is a mod_expires that I can use to append
> > the expires tag in the response header. But is it enough?
> What about the
> > cache-control tag or the no-cache pragma?

mod_expires does set a "Cache-Control: max-age" header. If you want
something else, you can use mod_headers to set whatever you want.

> > Another question is, if I have specified a file to be expired in 10 days
> > and that file is a symbolic link that points to another file which is
> > expired in 0 sec. What will be the actual caching behavior?

Apache looks at the settings for the original file, not the symlink. Of
course, you can and should easily confirm this yourself just by trying it
out.

Joshua.


---------------------------------------------------------------------
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
For additional commands, e-mail: users-help@httpd.apache.org
RE: Static file [ In reply to ]
I have just done a little testing. And I did see the Cache-Control header
with mod_expires. So, if I set the expiration date to be now, does it have
the same effect as pragma no-cache?

Also, if I set the symlink to be expire now while it's pointing something
expire in 1 day, I found that apache doesn't care the setting of the
destination file but just the symlink. Is this something as design? Anyone
has an idea?

--Chris

-----Original Message-----
From: Joshua Slive [mailto:joshua@slive.ca]
Sent: Wednesday, February 20, 2002 9:06 AM
To: users@httpd.apache.org
Subject: RE: Static file



> From: Chris Fong [mailto:chris.fong@digeo.com]

> > I would like to know how can I control the caching behavior of
> the static
> > files on apache. I know there is a mod_expires that I can use to append
> > the expires tag in the response header. But is it enough?
> What about the
> > cache-control tag or the no-cache pragma?

mod_expires does set a "Cache-Control: max-age" header. If you want
something else, you can use mod_headers to set whatever you want.

> > Another question is, if I have specified a file to be expired in 10 days
> > and that file is a symbolic link that points to another file which is
> > expired in 0 sec. What will be the actual caching behavior?

Apache looks at the settings for the original file, not the symlink. Of
course, you can and should easily confirm this yourself just by trying it
out.

Joshua.


---------------------------------------------------------------------
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
For additional commands, e-mail: users-help@httpd.apache.org

---------------------------------------------------------------------
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
For additional commands, e-mail: users-help@httpd.apache.org
RE: Static file [ In reply to ]
On Wed, 20 Feb 2002, Chris Fong wrote:

> I have just done a little testing. And I did see the Cache-Control header
> with mod_expires. So, if I set the expiration date to be now, does it have
> the same effect as pragma no-cache?

Not necessarily. If you want "no-cache", you should set it explictly.

>
> Also, if I set the symlink to be expire now while it's pointing something
> expire in 1 day, I found that apache doesn't care the setting of the
> destination file but just the symlink. Is this something as design? Anyone
> has an idea?

Yes, as I said:

>
> Apache looks at the settings for the original file, not the symlink. Of
> course, you can and should easily confirm this yourself just by trying it
> out.

Joshua.


---------------------------------------------------------------------
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
For additional commands, e-mail: users-help@httpd.apache.org