Question

How to enable mod_expires in Digital Ocean?

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.


Submit an answer

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!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hello @kunalchauhan

mod_expires should come with the default Apache installation, but you can check if the module is both installed and loaded using these commands

  1. apachectl -M | grep expires

If mod_expires is not enabled or installed you can run the following command to install mod_expires on Ubuntu/Debian systems

  1. sudo a2enmod mod_expires

Then you need to restart Apache

  1. service apache2 restart

That’s it, you now have mod_expires enabled.

Hope that this helps!