PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Hébergement serveur > comp.info.servers.unix > HTML -vs- image cache question
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
comp.info.servers.unix Web servers for UNIX platforms.

HTML -vs- image cache question

Réponse
 
LinkBack Outils de la discussion
Vieux 08/02/2005, 04h51   #1
fochie
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut HTML -vs- image cache question

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

  Réponse avec citation
Vieux 08/02/2005, 11h12   #2
Nick Kew
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: HTML -vs- image cache question

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
  Réponse avec citation
Vieux 08/02/2005, 19h45   #3
fochie
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: HTML -vs- image cache question

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 !!

  Réponse avec citation
Vieux 10/02/2005, 05h57   #4
Tim
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: HTML -vs- image cache question

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.
  Réponse avec citation
Vieux 10/02/2005, 20h15   #5
fochie
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: HTML -vs- image cache question


Hadn't thought of that annoying consequence when forcing a callback for
an HTML each time. I'm sure we can live with a 1 hr latency setting.

Thanks for the advice Tim !

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 13h16.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,12161 seconds with 13 queries