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
yup
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 RuleNo, 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
hmm like it didn't autodetect the www dns record?
no, it did not imported in rules the www redirect to root for 3 blogs, and it did for one
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
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
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
no integration of cloudflare, just my dns zone but there is no link between ghost and cloudflare
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
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 ?
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
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 ?
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
nice to know
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
what record am I supposed to find in history when filtering my domain ? there are a lot
page rule creation or update, if it was a while ago you might not be able to find it
it'd look something like this
and when you expand it
mmm I don't know when it has been created
but I can't find it in my history
this is the rule
that I never created but that does exist on my server
how long ago did you add that domain to Cloudflare?
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 ?
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
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
2 years ago in this discord you asked for help creating a page rule: https://discord.com/channels/595317990191398933/789155108529111069/901543452406317166
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
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)
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 ?
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
so no ROcket and no http/2 ? I actually turn it on while playing. Could this break something ?
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
ok I understand
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%)
and what about url normalisation ?
it is bad on mobile
I would just leave it alone unless you have a specific reason to touch it
url normalisation ?
yea
thank you very much for your help
is there something I can do to improve mobile metrics ?
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)
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 ?
Argo routing is not free, and is kind of pricey
oh okay
and super against bot ?
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
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
hmm, you self-host Ghost?
yep it is open source
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
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 ?
time to first byte (just a way of saying your server takes a while to send a response to a request)
yes
I don't find Cloudflare Edge, is that in the menu on the left ?
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
already activated
Oh wait 2022 isnt this year 😂
okay so its 18 months
ahh yea it says that
Audit Logs are retained for 18 months before being deletednot that its really feasible to click back through 18 months of audit logs on a semi-active Cf account lol
in Edge certificate settings, should I turn on the options ?
I am not able to activate total tls
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
If you select the entire range you can download them all as CSV to search... good luck
what about cache reserve ? it seems it cloud also help
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
weird because I've been able to activate it and it did not asked to pay
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
ok
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)
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 ? 🤔
wdym by "down", what error are you getting?
back again, I just cleared the cache...
I don't know what happened
it is a Digital Ocean incident