0

I'm trying to improve my websites speed and using GTMetrix for some analysis. I'm getting 2 recommendations I cannot sort.

Leverage browser caching for the following cacheable resources:

https://cellfina.co.uk/favicon.ico (expiration not specified)
https://cellfina.co.uk/wp-json/contact-form-7/v1/contact-forms/1102/refill

(expiration not specified) https://cellfina.co.uk/wp-json/contact-form-7/v1/contact-forms/1103/refill (expiration not specified) https://cellfina.co.uk/wp-json/contact-form-7/v1/contact-forms/1104/refill (expiration not specified) https://cellfina.co.uk/wp-json/contact-form-7/v1/contact-forms/1108/refill (expiration not specified) https://cellfina.co.uk/wp-json/contact-form-7/v1/contact-forms/1109/refill (expiration not specified) https://cellfina.co.uk/wp-json/contact-form-7/v1/contact-forms/1110/refill (expiration not specified) https://cellfina.co.uk/wp-json/contact-form-7/v1/contact-forms/1111/refill (expiration not specified) https://cellfina.co.uk/wp-json/contact-form-7/v1/contact-forms/1291/refill (expiration not specified) https://cellfina.co.uk/wp-json/contact-form-7/v1/contact-forms/1432/refill (expiration not specified) https://cellfina.co.uk/wp-json/contact-form-7/v1/contact-forms/881/refill (expiration not specified) https://www.googletagmanager.com/gtm.js?id=GTM-PS6VCD5 (15 minutes) https://connect.facebook.net/signals/config/2069824809931530?v=2.8.47&r=stable (20 minutes) https://www.google-analytics.com/analytics.js (2 hours)

and

The following resources are missing a cache validator. Resources that do not specify a cache validator cannot be refreshed efficiently. Specify a Last-Modified or ETag header to enable cache validation for the following resources:

https://cellfina.co.uk/favicon.ico
https://cellfina.co.uk/wp-json/contact-form-7/v1/contact-forms/1102/refill
https://cellfina.co.uk/wp-json/contact-form-7/v1/contact-forms/1103/refill
https://cellfina.co.uk/wp-json/contact-form-7/v1/contact-forms/1104/refill
https://cellfina.co.uk/wp-json/contact-form-7/v1/contact-forms/1108/refill
https://cellfina.co.uk/wp-json/contact-form-7/v1/contact-forms/1109/refill
https://cellfina.co.uk/wp-json/contact-form-7/v1/contact-forms/1110/refill
https://cellfina.co.uk/wp-json/contact-form-7/v1/contact-forms/1111/refill
https://cellfina.co.uk/wp-json/contact-form-7/v1/contact-forms/1291/refill
https://cellfina.co.uk/wp-json/contact-form-7/v1/contact-forms/1432/refill
https://cellfina.co.uk/wp-json/contact-form-7/v1/contact-forms/881/refill
https://connect.facebook.net/signals/config/2069824809931530?v=2.8.47&r=stable

Within the .htaccess file I have

ExpiresActive On
ExpiresByType text/css "access 1 month"
ExpiresByType text/html "access 1 month"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/x-icon "access 1 year"
ExpiresByType application/pdf "access 1 month"
ExpiresByType application/javascript "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresDefault "access 1 month"

which I would expect to deal with both the js and favicon files.

Why isn't it and how to I deal with the API calls?

  • What are the response headers for these resources? "which I would expect to deal with both" - mod_expires sets the Expires and Cache-Control headers, it doesn't do anything with Last-Modified or ETag headers (which are a different caching mechanism). But that notice looks advisory, not necessarily mandatory? Do you even want those (JSON?) responses / API calls cached? – DocRoot May 21 at 9:46
  • @DocRoot I would like the json calls cached because they return exactly the same info each time. I don't know why the developer wrote it like that, but it is what I have. Also, how should I set the Last-Modified and ETag for these items? – HenryM May 21 at 11:10

Your Answer

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

Browse other questions tagged or ask your own question.