64903
Goto Top

ExpiresByType im Apache für .js

Hallo,

ich habe einen Apache Webserver 2.2 auf einem Windows 2003 Server Enterprise Edition laufen.
Folgendes habe ich der httpd.conf hinzugefügt:

LoadModule expires_module modules/mod_expires.so

ExpiresActive On
ExpiresByType image/gif A86400
ExpiresByType image/jpeg A86400
ExpiresByType application/x-javascript A86400
ExpiresByType text/css A86400


Alle angegebenen Formate werden nun genau einen Tag im Cache gehalten, außer *.js - Dateien:

ExpiresByType application/x-javascript A86400

^^ Der MIME-Typ müsste aber so korrekt sein oder?

Woran liegts?

MfG
Olli

Content-ID: 112156

Url: https://administrator.de/forum/expiresbytype-im-apache-fuer-js-112156.html

Ausgedruckt am: 22.04.2025 um 03:04 Uhr

godlie
godlie 23.03.2009 um 16:06:52 Uhr
Goto Top
Hallo der mimeType:

application/javascript js

dürfte damit funktionieren evtl. grüße
64903
64903 24.03.2009 um 10:59:30 Uhr
Goto Top
Hallo godlie,

leider kommt dann folgende Meldung:

Syntax error on line...
ExpiresByType takes two arguments, a MIME type followed by an expiry date code


MfG
Olli
godlie
godlie 24.03.2009 um 13:47:16 Uhr
Goto Top
dann probiers mit:

application/javascript

das js is mir nur so reingerutscht
64903
64903 24.03.2009 um 14:30:43 Uhr
Goto Top
OK! Ohne das 'js' kommt zwar die Fehlermeldung nicht mehr,
trotzdem werden *.js nicht gecached auf dem Client.

Auf meinem lokalen Apache 2.2 funktioniert es allerdings mit:
ExpiresByType application/x-javascript A86400

Echt seltsam....
64903
64903 26.03.2009 um 08:32:05 Uhr
Goto Top
Manchmal ist die Lösung doch so einfach face-smile

Mit folgendem Eintrag funktionert's:

ExpiresByType text/javascript A86400

Also gelöst^^ !