I have been asked to enable mod_expires in digital ocean for header caching as well as browser caching. I don’t know where to look and enable it. If someone kind enough to share me document link or any guidance would be appreciated.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Click below to sign up and get $200 of credit to try our products over 60 days!
First you should check if it’s already enabled. To do so, you can run the following on CentOS
If nothing appears as output then you don’t have it enabled. Another way to verify it is via httpd.conf file, open apache configuration file in your favorite text editor application (Vi/ViM, Nano etc) and search for following line. If successfully found, then your Apache has mod_expires enabled.
For Ubuntu system, we need to use a2enmod utility to enable Apache modules, simply run following command to enable expires module on Ubuntu.
Once done, we need to restart apache for this change to take effect.
Now you have it enabled however you’ll need to configure it for extensions you need to cache. Now that’s entierly up to your preferences but there are different settings for that. You can check how to configure .jpeg or similar extenions.
Hope that helps.
mod_expiresshould come with the default Apache installation, but you can check if the module is both installed and loaded using these commands
If mod_expires is not enabled or installed you can run the following command to install mod_expires on Ubuntu/Debian systems
Then you need to restart Apache
That’s it, you now have mod_expires enabled.
Hope that this helps!