Low Percent Cache of my website (<30%)

What is the name of the domain?

What is the isssue you’re encountering

Low Percent Cache of my website (<30%)

What steps have you taken to resolve the issue?

I added cache everything rules on the caching rules, I added some bypass for dynamic content.
I also tried to block on WAF rules : Yandex & Russia Federation, because they was attacking my website.

Now, I asking myself 2 things

  • Does I have enough trafic on my website to load enough cache for cloudflare
  • Should I disable the cache options on my Prestashop.
    My configuration on “Performance” Prestashop 8.1
  • Cache : Enabled (Smarty)
  • Clear cache: each time there is a modification
  • Smart cache" for style sheets : Enabled
  • Smart cache" for JavaScript code
  • Apache Optimisation : Disabled
  • Cache : Enabled

When the website load without cache of cloudflare, the response time and TTFB are really slow, generally more than 2sec

Screenshot of the error

Hi there,

It seems like most of your assets are being bypassed in cache:

This happens when you have specific rules set to bypass the assets, the origin server instructs Cloudflare to bypass cache via Cache-Control header or when your origin web server sends cookies in the response header.

I notice that you have quite a few cache bypass rules. I would advise you to go through them and keep only the ones that are strictly necessary. Caching does make a difference in your website load speed, so you should only prevent caching on specific pages that might contain private data for instance.

Now, I asking myself 2 things

  • Does I have enough trafic on my website to load enough cache for cloudflare
  • Should I disable the cache options on my Prestashop.

As for prestashop cache - I usually don’t like to have 2 tiers of cache in different systems, but if this is working for you, I see no issues, I would however run a few lighthouse tests with prestashop cache enabled and disabled to see which performs better and then decide.
Regarding the traffic, Cloudflare cache evicts assets based on an algorithm called “least recently used” or LRU. This means that the least-requested content can be evicted from cache first, even before the age reached the Edge Cache TTL set, which also means that under the same conditions, generally speaking, a zone that has more traffic will have more hits than a zone with less traffic. But your main concern is not the LRU in my opinion, it’s the amount of bypassed assets.

Take care.

Hi,

Thanks for your help mcorreia !

I understood this “it’s the amount of bypassed assets.” only this morning by seeing the amount of html bypass !

So I learned that I should add a cache-control at my cache everything cache rules.

So, I did it and disabled the prestashop cache.
It looks like way better !

I will keep tracking the results on the following days.

Best regards

1 Like

What is the name of the domain?

What is the isssue you’re encountering

My add to cart button and cart pages don’t work as expected when everything in cache TTL 4h are enable

What steps have you taken to resolve the issue?

Hi,

I’m a cloudflare user with pro plan. I have set up a cache rule everything for my ecommerce website.
I also have created +10 bypass for pages with dynamic elements.

BUT, I have some issues. First of all, sometimes, the mini cart which is on header stay in cache, so sometimes on on a product category, I have a product on the mini cart, on another I have another product or no product at all. AND, when i’m on a product page, when I clic on add to cart, it doesn’t work.

I purged the cache to provide my customer the ability to purchase on the website…

But how can I do to keep the cache everything rules with 4h TTL (when enable the website is incredibly fast, when disable the website in generally really slow)
With a working mini cart and add to cart button.

Thanks so much in advance for your help !
If you need some informations do not hesitate.
(Ps : I’m not a dev and my dev cannot solve this until 3+ days and doesn’t know how to do right now…)

Finally, I got some issues, my customers cannot purchase on the website due to the cache…

But when the cache is enable, it take too much time to load the pages.

It’s really annoying when you’re not a dev guy or cloudflare experimented.
I would prefer to more the pro plan to have help on the installation, when it’s done it’s done -

So I opened a new ticket on the community support : Bypass Cache rules for dynamic elements

If you have the time to take a look, it would be helpful. At this rate I will end up stopping using cloudflare, it’s incredible when the cache works but horribly complicated and long to find solutions when it doesn’t.

If someone here is a cloudflare expert and I can pay him to solve this properly contact me…

You could somehow argue, - as it’s still about the cache that you tried to add to begin with, that is just getting complicated, I would still have kept them in the same thread.

As such, I have merged the two threads together.

I think we need to look in to them, and whether they take too much (or too little) - can you them bypass rules?

To get to:

With the “AJOUTER AU PANIER” button, there are only two requests for me, one POST to “/panier” and one POST to “/module/ps_shoppingcart/ajax”.

To get further, with “PASSER À LA CAISSE”, to:

We see two requests, which is one GET to “/panier” and one POST to “/module/tvcmsmegamenu/default”.

As such, the “URI Path” equals “/panier”, and “URI Path” starts with “/module/” would be my two primary concerns with the above these steps.

I would therefore suggest trying out with this rule:

That alone should over the procedure for the above (e.g. “AJOUTER AU PANIER” and “PASSER À LA CAISSE”).

We will however still need to look in to the (other) rules you have created, in order to see whether they take too much (or too little) away from the cache.

Hi, thanks for your help !

I disabled the Cache TTL option on my Cache Everything rule last Friday. This made it possible to continue taking orders, the add to cart buttons and the products in the carts are updated correctly when it is not activated.

On the other hand, when it is not activated, I have max 40% caching and almost no HTML is cached.

Which gives pages with “Request” of 6 seconds like here: https://www.sao-bio.fr/200-mode-ethique-bio-femme

Actually, maybe my original question is more: how to reduce TTFB via caching a prestashop 8 site via cloudflare.

On GTmetrix, with the URL that I shared above, it gives me 1.4s of TTFB, including 1.4 of “Backend”.

We purchased more powerful and recent server hosting 1 week ago.

We checked the tables.

The homepage loads quickly! (-1s) So my only solution remains the cache.

My cache everything rule is:
(http.host contains “sao-bio.fr”)

My bypass rule above is:
(http.request.uri.path contains “/admin”) or (http.request.uri.path contains “/my-account”) or (http.request.uri.path contains “/identite”) or (http. request.uri.path contains “/addresses”) or (http.request.uri.path contains “/order-history”) or (http.request.uri.path contains “/assessments”) or (http.request.uri .path contains “/reduction”) or (http.request.uri.path contains “/command-following”) or (http.request.uri.path contains “/modules”) or (http.request.uri.path contains “/module”) or (http.request.uri.path contains “/command”) or (http.request.uri.path contains “/ps_shoppingcart”) or (http.request.uri.path contains “/cart”) or (http.request.uri.path contains “/JavaScript”)

On the cache overview, I can see that 80% of the HTML cache is bypass
image

How to cache more html without breaking the mini cart or shopping cart (which are dynamic elements).

It seems like the initial load of your website is very slow:

In one of the page loads, I also had an extra request, where it apparently requested “page 2”, although that was without my own personal interference:

It seems to me like all of those slow ~ 5 seconds load times are mainly caused by having to load that initial request, with the size being in the area of 1,19 - 1,20 MB.

At the episode I had, where it also loaded that “?page=2”, that extra request was no different than the first, if we’re looking away from the query parameters. It was similarly in the size of 1,19 - 1,20 MB.

Was it just sold as “more powerful” and “recent” server hosting?

Or did you actually do some extensive research, and figured out the new package was exactly what you would need?

I’m not so sure that caching alone would mitigate the problem properly, and I would also suggest to look at things such as e.g.:

  1. Your server.

  2. Your Prestashop configuration.

That said, -

Can you try the following:

  1. Disable Rocket Loader.
    https://dash.cloudflare.com/?to=/:account/:zone/speed/optimization/content

  2. Enable Tiered Cache.
    https://dash.cloudflare.com/?to=/:account/:zone/caching/tiered-cache

  3. Purge Everything.
    https://dash.cloudflare.com/?to=/:account/:zone/caching/configuration

And then browse around your website, and see if that changes anything?

1 Like

First of all, thank you for your time and your help !

It seems to me like all of those slow ~ 5 seconds load times are mainly caused by having to load that initial request, with the size being in the area of 1,19 - 1,20 MB.
In one of the page loads, I also had an extra request, where it apparently requested “page 2”, although that was without my own personal interference:

Yes, I also saw that it is because of the initial request that it is long. This is what I mentioned in my previous message.

I think “?page=2” loads with the first page because I noticed that the “see the following products” button did not make “?=page2” appear in the URL (it’s an infinite scroll with button ).

Since it only skipped page 2, I asked my webdev to do something for that, I think that’s where it came from…

Was it just sold as “more powerful” and “recent” server hosting?

Or did you actually do some extensive research, and figured out the new package was exactly what you would need?

The decision was made in 15 minutes, my webdev was trying to correct the bottleneck which was slowing down the page request. He looked at metrics to choose.

We went with a 4vCore VPS, 8GB, 160 GB NVMe SSD, 1 Gbit/s unlimited.
The name is "Comfort’ here : Comparatif VPS : Quel Serveur Privé Virtuel choisir ? | OVHcloud France
For my webdev it seemed more than sufficient compared to what we had before.

Your server.

Your Prestashop configuration.

What do you think of when you say “Prestashop Configuration” ?
If you’re talking about Cache, I reviewed 4-5 sites which mentioned the settings to make to be sure.

As for the server, I just gave you a little more information, maybe you can tell me if my webdev is right to believe that the server is good?

I’m not so sure that caching alone would mitigate the problem properly

I understand, the cache is a bit like a bandage on an open wound, but I concluded that it was a good solution because the excessively long loading area corresponds to the round trip clic-server-site If I understood correctly. So I assumed that the site was fast and that the problem did not come from it.

Can you try the following:

Disable Rocket Loader.
→ https://dash.cloudflare.com/?to=/:account/:zone/speed/optimization/content

Enable Tiered Cache.
→ https://dash.cloudflare.com/?to=/:account/:zone/caching/tiered-cache

Purge Everything.
→ https://dash.cloudflare.com/?to=/:account/:zone/caching/configuration

And then browse around your website, and see if that changes anything?

I did like 20 minutes ago now (tiered cache was already enable).
It look’s like it’s exactly the same…

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.