Page rules detection

I have several Ghost blogs, for each of them I set up a 301 redirect when they were installed www to root. However, in the Cloudflare rules pages, the redirect only appears for one of my blogs, I don't understand why. It's as if Cloudflare didn't detect it for certain blogs.
70 Replies
Bastien
BastienOP2y ago
yup
Chaika
Chaika2y ago
Are you saying you created a Page rule before, and it's gone now? If you're saying it just doesn't work for the other blogs, you need to create an "originless" DNS Record so the traffic reaches Cloudflare and hits the redirect. AAAA www 100:: Proxied would do the trick. 100:: is IPv6 discard, just saying "If you get through the entire CF flow without hitting a redirect rule/etc, go nowhere". Even though this is an IPv6, since it is proxied, it'll work for both IPv4 & IPv6 Visitors to hit your Page Rule
Bastien
BastienOP2y ago
No, this is not exactly that I say that I manually created a redirect rule on my server for all my blogs, but when creating DNS zone in Cloudflare this redirect www to root domain is detected by Cloudflare by only one of the 4 blogs, and I don’t understand why
Chaika
Chaika2y ago
hmm like it didn't autodetect the www dns record?
Bastien
BastienOP2y ago
no, it did not imported in rules the www redirect to root for 3 blogs, and it did for one
Chaika
Chaika2y ago
Page Rules aren't imported or anything, it wouldn't create one for you, unless you or an integration did specifically you could check audit logs if it was recently enough to see what created itt
Bastien
BastienOP2y ago
It is maybe amazing but I never created the rule it has been automatically created for one of my blog and match exactly the 301 redirect I set up on my server but only in 1 case over 4 different websites
Chaika
Chaika2y ago
yea there's no auto import/auto creation based on your server doing a redirect or anything like that. If Ghost has an integration where you give it an CF API Key, then maybe it. Otherwise, you can check Audit Logs and filter for that specific domain, if it was recently enough it should show it
Bastien
BastienOP2y ago
no integration of cloudflare, just my dns zone but there is no link between ghost and cloudflare
Chaika
Chaika2y ago
Then most likely you created it. CF wouldn't auto create a page rule redirect for you, it wouldn't make sense anyway, some redirects are server-side and based on other attributes like IP/Country/etc, how would CF sense all of these? They don't
Bastien
BastienOP2y ago
I swear I never created it ! so in a way or another cloudflare understood or have been able to read it. or it created this rule because it is a famous rule ? but finally, what I would like to know is, can I delete this rule I set it up on my server directly ?
Chaika
Chaika2y ago
Sure, it could have been an integration or something else. The Audit logs are the only real way you'd find out, https://dash.cloudflare.com/?to=/:account/audit-log, you can filter by domain (just put your domain name/zone name).
so in a way or another cloudflare understood or have been able to read it. or it created this rule because it is a famous rule ?
No, my point was just that it's not feasible for Cloudflare to try to understand redirects. Cloudflare didn't create the page rule.
but finally, what I would like to know is, can I delete this rule I set it up on my server directly ?
Absolutely, if your server normally handles it you'd be fine. Cloudflare redirects are faster though and less load on your origin, if you can use them, I would
Bastien
BastienOP2y ago
to your mind, I would better use cloudflare redirect rather than my personal server redirect ? but in that case should I delete the redirect of my server ? or can I let both ?
Chaika
Chaika2y ago
If your redirect is simple enough to be in a Page rule/bulk redirect rule/dynamic redirect, Cloudflare. But I would keep both if you can, it won't hurt anything, if it matches Cloudflare, Cloudflare will serve it, and in case you ever need to pause Cloudflare/forget to set it up, you've got a backup
Bastien
BastienOP2y ago
nice to know
Chaika
Chaika2y ago
Yea, Cloudflare serving the redirect from the edge in 350+ cities is just going to be way faster then a single origin as well, and less origin traffic
Bastien
BastienOP2y ago
what record am I supposed to find in history when filtering my domain ? there are a lot
Chaika
Chaika2y ago
page rule creation or update, if it was a while ago you might not be able to find it
Chaika
Chaika2y ago
it'd look something like this
Chaika
Chaika2y ago
and when you expand it
Bastien
BastienOP2y ago
mmm I don't know when it has been created but I can't find it in my history
Bastien
BastienOP2y ago
Bastien
BastienOP2y ago
this is the rule that I never created but that does exist on my server
Chaika
Chaika2y ago
how long ago did you add that domain to Cloudflare?
Bastien
BastienOP2y ago
2 years ago, but I recently migrated the blog on the root domain so I don't know if this rule has been created recently or at the origin isn't it possible to filter the history to get only create actions ?
Chaika
Chaika2y ago
oh, yea Audit logs don't go that far back, I think like 90 days it's not possible to filter any further with a domain that old though, I'm pretty confident in saying it's very likely you created it (or someone else with access to that domain, if anyone), but maybe far in the past
Bastien
BastienOP2y ago
I am sure I don't as I don't know how to create this and no one has access ^^ so this is a mystery but at least now I know how to create it and that it can improve
Chaika
Chaika2y ago
2 years ago in this discord you asked for help creating a page rule: https://discord.com/channels/595317990191398933/789155108529111069/901543452406317166
Bastien
BastienOP2y ago
omg so that's me you are very clever I have no memory about it maybe a general question, I am looking to optimise my cloudflare settings to make my ghost blog faster is there anything you could recommend me ? I have no skills in this area so I am playing with Cloudlfare like a child with a toy
Chaika
Chaika2y ago
You could try using Page Rules/Cache rules to enable caching of html, but if your site is dynamic in anyway (allows user logins, comments, etc), it would mess with those If https://airprepa.co/blog/ is still your blog, it looks like the other assets are already being cached (and some have super long cache ages, nice)
Bastien
BastienOP2y ago
no actually the blog is now on root at https://airprepa.co, and yes there are some dynamic because the reader can log, pay, comment etc at least I could activate all the basics and free settings I see in SSL/TLS and Speed menu ?
Chaika
Chaika2y ago
yea, you can turn on a lot of things under Speed -> content/protocol optimization. Brolti, Early Hints, Auto minify (not Rocket loader), under protocol you can turn on everything in there except http/2 Prioritization
Bastien
BastienOP2y ago
so no ROcket and no http/2 ? I actually turn it on while playing. Could this break something ?
Chaika
Chaika2y ago
No rocket loader, it's a tool for the old web and more likely to just break things http/2 yea, I just mean you can't turn on http/2 prio without Pro or higher
Bastien
BastienOP2y ago
ok I understand
Chaika
Chaika2y ago
other then that, I mean your website looks fine to me https://gtmetrix.com/reports/airprepa.co/ZuOlmjzC/ You get good scores on gtmetrix, origin is a bit slow at times but not much you can do about that
GTmetrix Performance Report
GTmetrix Grade: A (Performance: 100% / Structure: 99%)
Bastien
BastienOP2y ago
and what about url normalisation ? it is bad on mobile
Chaika
Chaika2y ago
I would just leave it alone unless you have a specific reason to touch it
Bastien
BastienOP2y ago
url normalisation ?
Chaika
Chaika2y ago
yea
Bastien
BastienOP2y ago
thank you very much for your help is there something I can do to improve mobile metrics ?
Chaika
Chaika2y ago
https://pagespeed.web.dev/analysis/https-airprepa-co/psismft6tu?form_factor=mobile eh it's not great, it looks like one of the biggest things it complains about is Stripe isn't deferred (if you can), and the overall bundle size (don't think you can do much about that with Ghost)
Bastien
BastienOP2y ago
the Stripe integration is native so I am not able to modify it, but I will ask on forums how do bloggers reach beter scores and what about argo routing ?
Chaika
Chaika2y ago
Argo routing is not free, and is kind of pricey
Bastien
BastienOP2y ago
oh okay and super against bot ?
Chaika
Chaika2y ago
that's not going to help your loading speeds lol there is tiered cache, it might help you if Ghost has a single origin/server for your website it'd just help increase cache %, maybe helpful if ghost is really slow at serving static assets, but eh
Bastien
BastienOP2y ago
that is getting too technical for me aha, but I self host so yes I have a server for my website. But I am going to dockerize them soon to have multiple blogs on the same server
Chaika
Chaika2y ago
hmm, you self-host Ghost?
Bastien
BastienOP2y ago
yep it is open source
Chaika
Chaika2y ago
Tiered Cache basically picks a Cloudflare location closest to where it thinks your origin is, and all uncached requests for cachable assets go Cloudflare Edge -> Cloudflare Location closest to Origin -> Origin It can help increase cache and lower origin load hmm, ttfb is pretty high, could be your server being overutilized/not having enough resources
Bastien
BastienOP2y ago
this is sure, that's why I am dockerising and migrating to a better server I currently use 1 click Digital Ocean droplet but they are pretty expensive and bad for the cheapest ones what is ttfb ?
Chaika
Chaika2y ago
time to first byte (just a way of saying your server takes a while to send a response to a request)
Bastien
BastienOP2y ago
yes I don't find Cloudflare Edge, is that in the menu on the left ?
Chaika
Chaika2y ago
yea, Cloudflare has a lot of magic, but when you ultimately need the origin to respond for dynamic pages with payment, comments, etc, you just need your origin to be responsive. You can try things like enabling tiered cache (under cache -> tiered cache), to lower the amount of uncached requests your origin gets, and enabling other performance settings to try to help out/lower load on origin its in your website -> Caching -> Tiered Cache Magic link: https://dash.cloudflare.com/?to=/:account/:zone/caching/tiered-cache
Bastien
BastienOP2y ago
already activated
Erisa
Erisa2y ago
6 18 months
Erisa
Erisa2y ago
Oh wait 2022 isnt this year 😂 okay so its 18 months
Chaika
Chaika2y ago
ahh yea it says that
Audit Logs are retained for 18 months before being deleted
not that its really feasible to click back through 18 months of audit logs on a semi-active Cf account lol
Bastien
BastienOP2y ago
in Edge certificate settings, should I turn on the options ? I am not able to activate total tls
Chaika
Chaika2y ago
total tls isn't helpful anyway, it's part of ACM, it would automatically issue a cert for you, so you could go deeper then a single subdomain none of them will help performance but sure, Always use https is a smart idea unless you want to allow http requests, hsts can be helpful (but don't enable if you don't want to force every visitor to https/would want to turn it off in the future), TLS 1.3 is nice
Erisa
Erisa2y ago
If you select the entire range you can download them all as CSV to search... good luck
Bastien
BastienOP2y ago
what about cache reserve ? it seems it cloud also help
Chaika
Chaika2y ago
it's paid oh that's cool, I didn't know that, I thought it was just exporting a single page, that is a lot more useable Apparently my audit log is 60 MB and has 134,461 events, hmm. Still, if you knew what you were looking for, could fine it. It's not very user friendly though
Bastien
BastienOP2y ago
weird because I've been able to activate it and it did not asked to pay
Chaika
Chaika2y ago
Cache Reserve, or tiered cache? Cache Reserve is def paid, although if you have a subscription on your account from another zone it may not ask you to pay again/just asks you to enable. It's unlikely to help you imo, your static assets are quick enough to retrieve, and cache reserve is a rather nuclear option
Bastien
BastienOP2y ago
ok
Erisa
Erisa2y ago
Cache Reserve doesnt always help with performance since the assets go to cold storage in R2, its more of a tool to prevent origin requests at all costs (e.g. if calling your origin is expensive, its a good fit)
Bastien
BastienOP2y ago
makes sense my blog is down today, seems to be because of a bad Cloudflare manipulation yesterday, because my other blog is down too and I did not do anything on server side. Any idea how to solve ? 🤔
Erisa
Erisa2y ago
wdym by "down", what error are you getting?
Bastien
BastienOP2y ago
back again, I just cleared the cache... I don't know what happened it is a Digital Ocean incident

Did you find this page helpful?