Leverage Browser Caching – Bluehost
-
My GTMetrix report is telling me that I have a bunch of resources that I need to leverage browser caching for. I adjusted my .htaccess to the following (see below) but it hasn’t changed the page speed results:
RewriteEngine On RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] # BEGIN WordPress # The directives (lines) between "BEGIN WordPress" and "END WordPress" are # dynamically generated, and should only be modified via WordPress filters. # Any changes to the directives between these markers will be overwritten. <IfModule mod_expires.c> ExpiresActive On # Images ExpiresByType image/jpeg "access plus 1 year" ExpiresByType image/gif "access plus 1 year" ExpiresByType image/png "access plus 1 year" ExpiresByType image/webp "access plus 1 year" ExpiresByType image/svg+xml "access plus 1 year" ExpiresByType image/x-icon "access plus 1 year" # Video ExpiresByType video/webm "access plus 1 year" ExpiresByType video/mp4 "access plus 1 year" ExpiresByType video/mpeg "access plus 1 year" # Fonts ExpiresByType font/ttf "access plus 1 year" ExpiresByType font/otf "access plus 1 year" ExpiresByType font/woff "access plus 1 year" ExpiresByType font/woff2 "access plus 1 year" ExpiresByType application/font-woff "access plus 1 year" # CSS, JavaScript ExpiresByType text/css "access plus 1 month" ExpiresByType text/javascript "access plus 1 month" ExpiresByType application/javascript "access plus 1 month" # Others ExpiresByType application/pdf "access plus 1 month" ExpiresByType image/vnd.microsoft.icon "access plus 1 year" </IfModule> <ifModule mod_headers.c> Header set X-Endurance-Cache-Level "2" </ifModule> <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 # php -- BEGIN cPanel-generated handler, do not edit # Set the “ea-php73” package as the default “PHP” programming language. <IfModule mime_module> AddHandler application/x-httpd-ea-php73 .php .php7 .phtml </IfModule> # php -- END cPanel-generated handler, do not editI currently use Bluehost and I know that the following section in my .htaccess is from Bluehosts’ built in caching system:
<ifModule mod_headers.c> Header set X-Endurance-Cache-Level "2" </ifModule> <IfModule mod_rewrite.c>Could this be overriding my caching settings? If so, should I just disable Bluehosts’ built-in caching system completely and install a caching plugin like WP Rocket?
Thanks!
- This topic was modified 5 years, 5 months ago by . Reason: please use CODE button for code formatting
The page I need help with: [log in to see the link]
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘Leverage Browser Caching – Bluehost’ is closed to new replies.