1

there is a way to add Expire Headers for external static components?

Magento 2.2.2 CE

enter image description here

2 Answers 2

1

you can not control headers from external domain - but you dont have to.

many optimization are just misused.

the most important numbers are:

1 - TTFB - Time To First Byte - https://developers.google.com/web/tools/lighthouse/audits/ttfb

2 - FCP - First Contentful Paint - https://developers.google.com/web/tools/lighthouse/audits/first-contentful-paint

take care of these two, and you will be good to go.

also compress all your images, especially jpegs, even down to 65 quality + progressive.

and enable assets cache in varnish config:

https://github.com/magento/magento2/blob/2.3/app/code/Magento/PageCache/etc/varnish5.vcl#L102

forget about everything else.

2

Expires Headers are used by the web browser in order to specify the period for a page component to staying in the cache. We can control expires for static contents which should have longer expires headers. You can activate this by adding the following lines below.

In .htaccess file :-

<IfModule mod_expires.c>
############################################
## Add default Expires header
ExpiresActive On
ExpiresDefault "access plus 1 year"
</IfModule>

6 Tips To Speed Up Magento Frontend Performance

Reference Link

1
  • you can not control headers for external domain. please read the question, do not confuse with your spam.
    – MagenX
    May 13, 2019 at 20:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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