.htaccess of WordPress to improve the yield

Last revision: 26 of April of 2020

Table of contents

If you use perhaps Apache httpd or LiteSpeed or any system based on these Web servers interests to you to form the file .htaccess by the root of the configuration of your WordPress of a complex way (more from the one than she comes by defect).

Configurations in concrete blocks

Cache of static in the navigator

The navigators can frisk of a more aggressive form determined files. As habitually the files do not change, it is possible to be forced to that they keep on the part of the user.

# START Browser breaks <IfModule mod_expires.c> ExpiresActive on ExpiresByType application/pdf A2592000 ExpiresByType image/x-icon A2592000 ExpiresByType image/vnd.microsoft.icon A2592000 ExpiresByType image/svg+xml A2592000 ExpiresByType image/jpg A2592000 ExpiresByType image/JPEG A2592000 ExpiresByType image/png A2592000 ExpiresByType image/GIF A2592000 ExpiresByType image/webp A2592000 ExpiresByType video/ogg A2592000 audio ExpiresByType/ogg A2592000 ExpiresByType video/mp4 A2592000 ExpiresByType video/webm A2592000 ExpiresByType text/css A604800 ExpiresByType text/Javascript A604800 ExpiresByType application/Javascript A604800 ExpiresByType application/x-Javascript A604800 ExpiresByType application/x-font-ttf A2592000 ExpiresByType application/x-font-woff A2592000 ExpiresByType application/font-woff A2592000 ExpiresByType application/font-woff2 A2592000 ExpiresByType application/vnd.ms-fontobject A2592000 ExpiresByType font/ttf A2592000 ExpiresByType font/woff A2592000 ExpiresByType font/woff2 A2592000 </IfModule> # END Browser breaks

In this case, the images and similars would be frisked during a month, the CSS and Javascript one week and the files from sources, a month would keep.

Compression of the contents

The contents that can be compressed (mainly those of text) can be sent of fast form being able to reduce between a 60% and a 80% the consumed bandwidth. .htaccess improved for WordPress

# BEGIN HttpHeadersCompression <IfModule mod_deflate.c> AddOutputFilterByType DEFLATE application/Javascript AddOutputFilterByType DEFLATE application/x-Javascript AddOutputFilterByType DEFLATE application/json AddOutputFilterByType DEFLATE application/ld+json AddOutputFilterByType DEFLATE application/manifest+json AddOutputFilterByType DEFLATE application/rdf+xml AddOutputFilterByType DEFLATE application/rss+xml AddOutputFilterByType DEFLATE application/schema+json AddOutputFilterByType DEFLATE application/vnd.geo+json AddOutputFilterByType DEFLATE application/x-Web-app-manifest+json AddOutputFilterByType DEFLATE application/vnd.ms-fontobject AddOutputFilterByType DEFLATE application/x-font-ttf AddOutputFilterByType DEFLATE application/xhtml+xml AddOutputFilterByType DEFLATE application/xml AddOutputFilterByType DEFLATE font/opentype AddOutputFilterByType DEFLATE font/eot AddOutputFilterByType DEFLATE image/bmp AddOutputFilterByType DEFLATE image/svg+xml AddOutputFilterByType DEFLATE image/x-icon AddOutputFilterByType DEFLATE image/vnd.microsoft.icon AddOutputFilterByType DEFLATE text/Javascript AddOutputFilterByType DEFLATE text/css AddOutputFilterByType DEFLATE text/HTML AddOutputFilterByType DEFLATE text/plain AddOutputFilterByType DEFLATE text/x-component AddOutputFilterByType DEFLATE text/xml </IfModule> # END HttpHeadersCompression