Caching a WordPress website is easier with any caching plugin available in the WordPress repository. But sometimes you may feel that a lot of plugin may slow down your lovely website. That’s why you may choose to add code to your website instead of adding multiple plugins.
Here is my solution to leverage browser caching along with enabling compression. Open your
.htaccess file located at the root of your WordPress installation. Leave the original code as it is and copy-paste the following gist code just below it: