PSD-Tutorials.de
Forum für Design, Fotografie & Bildbearbeitung
Tutkit
Agentur
Hilfe
Kontakt
Start
Forum
Aktuelles
Besonderer Inhalt
Foren durchsuchen
Tutorials
News
Anmelden
Kostenlos registrieren
Aktuelles
Suche
Suche
Nur Titel durchsuchen
Von:
Menü
Anmelden
Kostenlos registrieren
App installieren
Installieren
JavaScript ist deaktiviert. Für eine bessere Darstellung aktiviere bitte JavaScript in deinem Browser, bevor du fortfährst.
Du verwendest einen veralteten Browser. Es ist möglich, dass diese oder andere Websites nicht korrekt angezeigt werden.
Du solltest ein Upgrade durchführen oder einen
alternativen Browser
verwenden.
Antworten auf deine Fragen:
Neues Thema erstellen
Start
Forum
Sonstiges
Webdesign, Webentwicklung & Programmierung
CMS, Shopsoftware & Forensysteme
WordPress
Leverage Browser Caching mit .htaccess
Beitrag
<blockquote data-quote="Coulyo" data-source="post: 2320778" data-attributes="member: 577378"><p>Hallo!</p><p></p><p>Ich würde gerne die Resourcen auf meiner Website mittels.htaccess-Datei cachen. Dazu habe ich den Code unten in die von Wordpress automatisch generierte .htaccess kopiert (die liegt im Hauptordner der Wordpress Installation). Den Code habe ich so oder so ähnlich auf mehreren Webseiten gefunden, aber er scheint nicht zu funktionieren (sagen Google Page Speed und pingdom).</p><p>Jemand eine Idee? <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite1" alt=":)" title="Smile :)" loading="lazy" data-shortname=":)" /></p><p></p><p>Die ganze .htaccess sieht so aus:</p><p>[CODE]# BEGIN WordPress</p><p><IfModule mod_rewrite.c></p><p>RewriteEngine On</p><p>RewriteBase /</p><p>RewriteRule ^index\.php$ - [L]</p><p>RewriteCond %{REQUEST_FILENAME} !-f</p><p>RewriteCond %{REQUEST_FILENAME} !-d</p><p>RewriteRule . /index.php [L]</p><p></IfModule></p><p></p><p># END WordPress</p><p></p><p># ------------------------------------------------------------------------------</p><p># | Expires headers |</p><p># ------------------------------------------------------------------------------</p><p></p><p># The following expires headers are set pretty far in the future. If you</p><p># don't control versioning with filename-based cache busting, consider</p><p># lowering the cache time for resources such as style sheets and JavaScript</p><p># files to something like one week.</p><p></p><p><IfModule mod_expires.c></p><p></p><p> ExpiresActive on</p><p> ExpiresDefault "access plus 1 month"</p><p></p><p> # CSS</p><p> ExpiresByType text/css "access plus 1 year"</p><p></p><p> # Data interchange</p><p> ExpiresByType application/json "access plus 0 seconds"</p><p> ExpiresByType application/ld+json "access plus 0 seconds"</p><p> ExpiresByType application/xml "access plus 0 seconds"</p><p> ExpiresByType text/xml "access plus 0 seconds"</p><p></p><p> # Favicon (cannot be renamed!) and cursor images</p><p> ExpiresByType image/x-icon "access plus 1 week"</p><p></p><p> # HTML components (HTCs)</p><p> ExpiresByType text/x-component "access plus 1 month"</p><p></p><p> # HTML</p><p> ExpiresByType text/html "access plus 0 seconds"</p><p></p><p> # JavaScript</p><p> ExpiresByType application/javascript "access plus 1 year"</p><p></p><p> # Manifest files</p><p> ExpiresByType application/x-web-app-manifest+json "access plus 0 seconds"</p><p> ExpiresByType text/cache-manifest "access plus 0 seconds"</p><p></p><p> # Media</p><p> ExpiresByType audio/ogg "access plus 1 month"</p><p> ExpiresByType image/gif "access plus 1 month"</p><p> ExpiresByType image/jpeg "access plus 1 month"</p><p> ExpiresByType image/png "access plus 1 month"</p><p> ExpiresByType video/mp4 "access plus 1 month"</p><p> ExpiresByType video/ogg "access plus 1 month"</p><p> ExpiresByType video/webm "access plus 1 month"</p><p></p><p> # Web feeds</p><p> ExpiresByType application/atom+xml "access plus 1 hour"</p><p> ExpiresByType application/rss+xml "access plus 1 hour"</p><p></p><p> # Web fonts</p><p> ExpiresByType application/font-woff "access plus 1 month"</p><p> ExpiresByType application/vnd.ms-fontobject "access plus 1 month"</p><p> ExpiresByType application/x-font-ttf "access plus 1 month"</p><p> ExpiresByType font/opentype "access plus 1 month"</p><p> ExpiresByType image/svg+xml "access plus 1 month"</p><p></p><p></IfModule>[/CODE]</p></blockquote><p></p>
[QUOTE="Coulyo, post: 2320778, member: 577378"] Hallo! Ich würde gerne die Resourcen auf meiner Website mittels.htaccess-Datei cachen. Dazu habe ich den Code unten in die von Wordpress automatisch generierte .htaccess kopiert (die liegt im Hauptordner der Wordpress Installation). Den Code habe ich so oder so ähnlich auf mehreren Webseiten gefunden, aber er scheint nicht zu funktionieren (sagen Google Page Speed und pingdom). Jemand eine Idee? :) Die ganze .htaccess sieht so aus: [CODE]# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress # ------------------------------------------------------------------------------ # | Expires headers | # ------------------------------------------------------------------------------ # The following expires headers are set pretty far in the future. If you # don't control versioning with filename-based cache busting, consider # lowering the cache time for resources such as style sheets and JavaScript # files to something like one week. <IfModule mod_expires.c> ExpiresActive on ExpiresDefault "access plus 1 month" # CSS ExpiresByType text/css "access plus 1 year" # Data interchange ExpiresByType application/json "access plus 0 seconds" ExpiresByType application/ld+json "access plus 0 seconds" ExpiresByType application/xml "access plus 0 seconds" ExpiresByType text/xml "access plus 0 seconds" # Favicon (cannot be renamed!) and cursor images ExpiresByType image/x-icon "access plus 1 week" # HTML components (HTCs) ExpiresByType text/x-component "access plus 1 month" # HTML ExpiresByType text/html "access plus 0 seconds" # JavaScript ExpiresByType application/javascript "access plus 1 year" # Manifest files ExpiresByType application/x-web-app-manifest+json "access plus 0 seconds" ExpiresByType text/cache-manifest "access plus 0 seconds" # Media ExpiresByType audio/ogg "access plus 1 month" ExpiresByType image/gif "access plus 1 month" ExpiresByType image/jpeg "access plus 1 month" ExpiresByType image/png "access plus 1 month" ExpiresByType video/mp4 "access plus 1 month" ExpiresByType video/ogg "access plus 1 month" ExpiresByType video/webm "access plus 1 month" # Web feeds ExpiresByType application/atom+xml "access plus 1 hour" ExpiresByType application/rss+xml "access plus 1 hour" # Web fonts ExpiresByType application/font-woff "access plus 1 month" ExpiresByType application/vnd.ms-fontobject "access plus 1 month" ExpiresByType application/x-font-ttf "access plus 1 month" ExpiresByType font/opentype "access plus 1 month" ExpiresByType image/svg+xml "access plus 1 month" </IfModule>[/CODE] [/QUOTE]
Bilder bitte
hier hochladen
und danach über das Bild-Icon (Direktlink vorher kopieren) platzieren.
Zitate einfügen…
Authentifizierung
Der grüne Frosch hüpft über die Hügel an den Bäumen vorbei in die Höhle. Bitte nenne das zweite Wort!
Antworten
Start
Forum
Sonstiges
Webdesign, Webentwicklung & Programmierung
CMS, Shopsoftware & Forensysteme
WordPress
Leverage Browser Caching mit .htaccess
Oben