How to fix gtmetrix to Add Expires headers?

Good evening to All!

The client hit the optimization on the website gtmetrix.com
I can't think of a solution for this item Add Expires headers 4NkydMTISwOZwa4Kxuy8YA.png
Maybe someone faced and can prompt a human solution to this issue?

Thanks in advance!
March 19th 20 at 09:14
3 answers
March 19th 20 at 09:16
Solution
On the host, set the cache storage of static objects 365 days
March 19th 20 at 09:18
From here:
# ----------------------------------------------------------------------
# Expires headers (for better cache control)
# ----------------------------------------------------------------------

# These are pretty far-future expires headers.
# They assume you control versioning with filename-based cache busting
# Additionally, consider that outdated proxies may miscache
# www.stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring/

# If you don't use filenames to version, lower the CSS and JS to something like
# "access plus 1 week".

<IfModule mod_expires.c>
 ExpiresActive on

# Your document html
 ExpiresByType text/html "access plus 0 seconds"

# Media: images, video, audio
 ExpiresByType audio/ogg "access plus 1 month"
 ExpiresByType image/gif "access plus 1 month"
 ExpiresByType image/jpeg "access plus 1 month"
 ExpiresByType image/png "access plus 1 month"
 ExpiresByType video/mp4 "access plus 1 month"
 ExpiresByType video/ogg "access plus 1 month"
 ExpiresByType video/webm "access plus 1 month"

# CSS and JavaScript
 ExpiresByType application/javascript "access plus 1 year"
 ExpiresByType text/css "access plus 1 year"
</IfModule>
Thanks for the reply. Tried, to no avail - frieda commented on March 19th 20 at 09:21
March 19th 20 at 09:20
Maybe someone faced and can prompt a human solution to this issue?


Discard these scripts, if they are not needed.
Practice is that you can'T affect your scripts and can't finish them with the appropriate headers, but you CAN reduce their number.

Find more questions by tags 1C-BitrixApache