A
A
Apxu2019-03-29 22:03:30
Apache HTTP Server
Apxu, 2019-03-29 22:03:30

How to fix Add Expires headers in gtmetrix?

Good evening everyone!
The client got into optimization on the site gtmetrix.com We
just can't come up with a solution for this item Add Expires headers 4NkydMTISwOZwa4Kxuy8YA.png
Perhaps someone has come across and can suggest a human solution to this issue?
Thanks in advance!

Answer the question

In order to leave comments, you need to log in

3 answer(s)
Y
Yaroslav Alexandrov, 2019-04-01
@Apxu

On the hosting, set the storage of the cache of static objects for 365 days

M
Mysterion, 2019-03-29
@Mysterion

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>

A
Andrey Nikolaev, 2019-03-30
@gromdron

Perhaps someone came across and can suggest a human solution to this issue?

Discard these scripts if they are not needed.
The practice is that you CANNOT influence NOT your scripts and you CANNOT add appropriate headers to them, but you CAN reduce the number of them.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question