0
votes

We are using the Google Page Speed Tool.

It says we should use "Leverage Browser Caching" for images.

In the httpd.conf we use "ExpiresByType" with 1 month.

The "max-age" in the response of the image is set to 1 month but the "Expires" is set to 1 day.

Google Page speed is ignoring the "Max-age" and interpreting the "Expires" and thus giving the warning.

How can we set the "Expires" instead of "Max-age" though Mod_expires?

1

1 Answers

0
votes

Google Page speed is ignoring the "Max-age" and interpreting the "Expires" and thus giving the warning.

That would be a bug. RFC 7234 states:

If a response includes a Cache-Control field with the max-age directive (Section 5.2.2.8), a recipient MUST ignore the Expires field.

By default, mod_expires controls

the setting of the Expires HTTP header and the max-age directive of the Cache-Control HTTP header in server responses.

So both headers should contain the same effective expiry time.

You may have another setting (mod_headers?), you may be misinterpreting the headers, an extra proxy may be involved or you could have found a bug.