I have problem with expires headers.

I am using magento cloud with nginx server.

  • I have updated my answer specific to nginx – Shoaib Munir Jan 31 '19 at 9:54
  • @ShoaibMunir I have tried it but it doesn't worked for me because of magento cloud. if you are give me magento cloud specific solution that will work for me. – Ambrish Maradiya Jan 31 '19 at 10:30
  • Did you resolve your issue? – Shoaib Munir Feb 6 '19 at 10:00
  • No @ShoaibMunir can not get success on this. – Ambrish Maradiya Feb 7 '19 at 12:20

You can add Cache-Control headers in Nginx by adding the following to your server config’s server location or block.

location ~*  \.(jpg|jpeg|gif|png|svg)$ {
    expires 365d;

location ~*  \.(pdf|css|html|js|swf)$ {
    expires 2d;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.