Caching unterbinden bei statischen Websites

gegenwind

gegenwind

Aktives Mitglied
Thread Starter
Dabei seit
06.12.2008
Beiträge
575
Reaktionspunkte
25
Hallo Leute,
ich habe ein paar statische Websites. Auf der Startseite werden unregelmäßig Neuigkeiten hinzugefügt (nur Text).
Wie stelle ich es an, dass der Text jedes Mal neu geladen wird, aber die Bilder nicht?
Cache hat ja eben auch seine Vorteile (grafische Elemente werden schneller geladen), daher würde ich das Caching-Verbot gerne
nur auf Text anwenden.
HTML:
<meta http-equiv="cache-control" content="no-cache">
… ist mir also zu simpel.

Vielen Dank, falls jemand von euch eine Lösung kennt!
 
Hi,

lasse alles via htaccess lange cachen was nicht Text ist: (apache server only)
HTML:
<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresDefault "access plus 300 seconds"
  ExpiresByType image/gif "access plus 1 month 1 hour"
  ExpiresByType image/jpg "access plus 1 month 1 hour"
  ExpiresByType image/jpeg "access plus 1 month 1 hour"
  ExpiresByType image/png "access plus 1 month 1 hour"
  ExpiresByType application/x-shockwave-flash "access plus 1 day 1 hour"
</IfModule>

ExpiresByType text/css "access plus 1 day 1 hour"
ExpiresByType text/javascript "access plus 7 days 1 hour"
ExpiresByType application/x-javascript "access plus 7 days 1 hour"

:teeth:
 
Zurück
Oben Unten