Why html of the page and icons are not cached?

#1

Please see in waterfall first position which is link to the page.

Cache-Control

max-age=0, no-cache, no-store, must-revalidate

Pragma

no-cache

I have integration with cloudflare and have standard caching level.

Eleganticons.woff is icon from homepage and it is not cached too (status: MISS)

0 Likes

#2

HTML is not cached by default since it could reveal highly sensitive information. See:

It’s not a good idea to cache the HTML if there is any dynamic content, such as wordpress’ top “admin” bar or anything that only shows up when you’re logged in.

If you really do want to cache HTML, your page rule would need the “edge cache TTL” option. Remember, this is highly dangerous.


As for Eleganticons, i’m not sure why it’s unable to cache it. Maybe something to do with the accept-range? I’ll see if anyone else can figure that out :stuck_out_tongue:

1 Like

#3

Thanks. Why this is dangerous?

When ive enabled caching static html then icons are cached too!

0 Likes

#4

Hm. You were right. My admin bar is still visible even when i logout. I added page rule to not cache wp_admin but it didn’t work for that. How to help?

0 Likes

#5

This is the problem with WordPress and “cache everything”, it will cache the entire HTML. There’s not much that could be done to fix this, other than loading the admin bar via javascript, but that would require some code work.

Rather than using Cloudflare, I would recommend WP fastest cache. This will safely cache pages so they’re not always re-rendered, but it will do it safely so that the admin bar isn’t being cached and served to logged out visitors.

0 Likes

#6

I don’t know how, but admin bar is not cached now. Problem is other. Comment forms (wpdiscuz) are cached and my login and mail details…

0 Likes