|
|
|
|
||||||
| comp.info.servers.unix Web servers for UNIX platforms. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 (permalink) |
|
Messages: n/a
Hébergeur: |
Greetings,
Not sure if this the "right" place to ask ... I would like to be able to serve up HTML pages, that contain 100's of links to images on my server and have the images ALWAYS cached by the client/proxy server/etc. but NEVER the HTML page itself. My HTMLs are updated daily to contain new image links along with potentially many of the old links remaining. New links added always use new image filenames and the names never reused. The old images are removed from the server when the HTML is updated. The problem I'm seeing is that without any cache mechanism the HTML page itself is being cached, which then contains links to non existant images on my server. If I include HTTP expire headers to effectively never cache the HTML page, I think I then loose the performance gain of having the images themselves remain in cache. Is there a way to handle both of these cases where I want to have images served from cache whenever possible yet the HTML that contains the links to them never cached ? Any insight/advice/assistance is most appreciated. Thanks ! Envir - Dedicated Linux RHEL3 Intel server Apache |
|
|
|
#2 (permalink) |
|
Messages: n/a
Hébergeur: |
fochie wrote:
> Greetings, > > Not sure if this the "right" place to ask ... > > I would like to be able to serve up HTML pages, that contain 100's of > links to images on my server and have the images ALWAYS cached by the > client/proxy server/etc. but NEVER the HTML page itself. No chance. You can't force or prevent cacheing unless you control the Client. The best you can do is to set headers that agents will honour *unless* configured to do otherwise (e.g. browser preferences). > My HTMLs are updated daily to contain new image links along with > potentially many of the old links remaining. New links added always use > new image filenames and the names never reused. The old images are > removed from the server when the HTML is updated. OK, what you want is default behaviour in Apache and (AFAIK) other webservers, provided you don't mess with it. Look up the HTTP If-Modified-Since header and 304 response for how it works. -- Nick Kew |
|
|
|
#3 (permalink) |
|
Messages: n/a
Hébergeur: |
Thanks Nick,
After a little more reading I'm note sure why the solution below wouldn't solve my problem - Again, the goal as I see it is to have web cache proxies, and client browsers, respect the following - NEVER cache my HTML files ALWAYS cache my image files when possible Since we already recompiled our Apache server to include "mod_expires", I think adding the following initial directives to our Apache config may accomplish what I'm after - ExpiresActive on ExpiresByType text/html "access plus 0 hours" ExpiresByType image/jpeg "access plus 10 days" ExpiresByType image/gif "access plus 2 days" ExpiresDefault "access plus 2 days" I would look at finer grained cache control via .htaccess and HTTP headers after judging the effects of the change described above. Anyone see any problems with this approach ? Thanks !! |
|
|
|
#4 (permalink) |
|
Messages: n/a
Hébergeur: |
On 8 Feb 2005 11:45:35 -0800,
"fochie" <sborruso@austin.rr.com> posted: > ExpiresByType text/html "access plus 0 hours" Make that longer. There's nothing more annoying that navigating through a site and having to slowly reload a page you just looked at a few minutes ago, because you have to go back to it to navigate to something else. It's because of this daft sort of thing that some caches ignore instructions from servers. At the very least make it ten minutes. That gives navigation time for most people, and keeps things current enough for rapidly changing sites. Though I'd make it at least an hour. It's extremely annoying to try and go back to read something that caught your interest, only to find that it's gone. -- If you insist on e-mailing me, use the reply-to address (it's real but temporary). But please reply to the group, like you're supposed to. This message was sent without a virus, please delete some files yourself. |
|
![]() |
| Outils de la discussion | |
|
|