Post by depos » Wed Aug 05, 2020 4:24 pm

Hi!

I try for a few days to solve the score in gtmatrix for cache validator. But till now, no chance. I try many variants in htaccess but still 0.

Newbie

Posts

Joined
Mon Jun 29, 2020 7:58 pm

Post by letxobnav » Wed Aug 05, 2020 7:23 pm

url?

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Newbie

Posts

Joined
Mon Jun 29, 2020 7:58 pm

Post by letxobnav » Mon Aug 10, 2020 3:08 pm

First, you are using cloudflare which is never good to troubleshoot your own server as cf also sends its own control headers, better make sure your site works properly before you enable cf.

Second, you have assets with an cache expiration date set to expire Fri, 21 Dec 2100 00:00:00 GMT which is rather long.
Then again, I do not know who sets that header, your server or cf.

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by depos » Mon Aug 10, 2020 3:27 pm

For Header set Expires I set 6 months.
For first answer, can you help me with an advice?

I lost 1 week to try to solve this problem :(

Newbie

Posts

Joined
Mon Jun 29, 2020 7:58 pm

Post by letxobnav » Mon Aug 10, 2020 5:31 pm

For first answer, can you help me with an advice?
I don't know if you can turn cf off/on with a switch, I doubt it as that would be a dns issue.
But it goes for any external cache/proxy extension or service, first make sure YOUR site functions before engaging those.
For Header set Expires I set 6 months.
I don't think so.
for your assets you send:

Code: Select all

cache-control: public, max-age=31536000
sets expiration to a year and tells any receiver it can cache it.
A year is long, especially if you change your js/css/images more frequent than that.
Users who have cached those will not see any of the changes you have made there in a year.

Code: Select all

expires: Tue, 21 Dec 2100 00:00:00 GMT
sets expiration to the end of 2100
Don't know who sets this but max-age and expires are normally equal (max-age in seconds, expires as date), still max-age overrides expires anyway.
That still makes it a year, not 6 months.

your html sends:

Code: Select all

cache-control: public, max-age=0
sets any receiver, you may cache but verify if the cached version is up to date before using it.
which should not be as your html should never be cached hence verification is futile and slows.
better send:

Code: Select all

cache-control: no-store
you can do that by either setting the html expiration to now in htaccess or have the response class send that header as all dynamic html goes thru that.
cf send this:

Code: Select all

cf-cache-status: DYNAMIC
which basically means that they do not cache it but forward the request to your server.
That is what it should do, it is also the drawback of cdn with dynamic content as it adds a hop to the latency, i.e. cdns slow dynamic content.
That additional delay adds to your already slow TTFB.

Still, you have set expiration headers and as far as I can see they work so just ignore what GTmetrix recommends as that is often questionable.
Just check what headers your responses are setting and check if assets are cached or not in your web developer tools.
That is more reliable than all those speed verification sites put together with their recommendations.

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan
Who is online

Users browsing this forum: No registered users and 9 guests