How to add expires header in Wordpress | Expires header

preview_player
Показать описание
In this video, we show you step-by-step how to add expires headers in both Wordpress and cPanel. Expires headers can help improve the performance of your website by telling the browser to cache certain files, reducing the number of HTTP requests made to the server. This can lead to faster page load times, which can ultimately improve the user experience.

In the first half of the video, we show you how to add expires headers in cPanel. This method is more technical and requires access to the server. We walk you through the process of editing the .htaccess file and show you the code that needs to be added. We also show you how to test that the expires headers are working correctly.

In the second half of the video, we demonstrate how to add expires headers in Wordpress using a plugin. This plugin is simple to use and can be installed directly from the Wordpress repository. We show you how to configure the plugin and how to test that the expires headers are working properly.

Overall, this video is a great resource for anyone looking to improve the performance of their website. By adding expires headers, you can help reduce the number of HTTP requests made to the server, which can lead to faster page load times and a better user experience.

Here is the code:

## EXPIRES HEADER CACHING ##
ExpiresActive On
ExpiresByType image/jpg “access 1 year”
ExpiresByType image/jpeg “access 1 year”
ExpiresByType image/gif “access 1 year”
ExpiresByType image/png “access 1 year”
ExpiresByType image/svg “access 1 year”
ExpiresByType text/css “access 1 month”
ExpiresByType application/pdf “access 1 month”
ExpiresByType application/javascript “access 1 month”
ExpiresByType application/x-javascript “access 1 month”
ExpiresByType application/x-shockwave-flash “access 1 month”
ExpiresByType image/x-icon “access 1 year”
ExpiresDefault “access 2 days”
## EXPIRES HEADER CACHING ##
Рекомендации по теме