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-Key: 112156

Url: https://administrator.de/contentid/112156

Printed on: April 18, 2024 at 10:04 o'clock

Member: godlie
godlie Mar 23, 2009 at 15:06:52 (UTC)
Goto Top
Hallo der mimeType:

application/javascript js

dürfte damit funktionieren evtl. grüße
Mitglied: 64903
64903 Mar 24, 2009 at 09:59:30 (UTC)
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
Member: godlie
godlie Mar 24, 2009 at 12:47:16 (UTC)
Goto Top
dann probiers mit:

application/javascript

das js is mir nur so reingerutscht
Mitglied: 64903
64903 Mar 24, 2009 at 13:30:43 (UTC)
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....
Mitglied: 64903
64903 Mar 26, 2009 at 07:32:05 (UTC)
Goto Top
Manchmal ist die Lösung doch so einfach face-smile

Mit folgendem Eintrag funktionert's:

ExpiresByType text/javascript A86400

Also gelöst^^ !