2.5 KiB
2.5 KiB
| project | type | status | path | tags | created | updated | ||||
|---|---|---|---|---|---|---|---|---|---|---|
| cloudflare-cache-warmer | project-plan | active | Tech/Projects |
|
2026-04-20 | 2026-04-20 |
Cloudflare Cache Warmer — n8n Workflow
Problem
Recipe pages fall out of Cloudflare's edge cache between human visits. When Googlebot crawls a cold page, it hits WordPress directly — full PHP/plugin execution, slow response. Google deprioritizes slow pages and marks them "Crawled - currently not indexed."
Solution
Scheduled n8n workflow that fetches the sitemap daily and hits every recipe URL to keep Cloudflare's cache warm. Googlebot always gets a fast cached response.
Architecture
- Schedule Trigger — runs once daily (off-peak, e.g. 4:00 AM ET)
- HTTP Request — fetch
https://plantbasedsoutherner.com/sitemap_index.xml - XML Parse — extract child sitemap URLs from the index
- Loop — for each child sitemap:
- HTTP Request — fetch the child sitemap XML
- XML Parse — extract all `` URLs
- Loop — for each URL:
- HTTP Request (GET) — hit the URL (this warms the cache)
- Wait — small delay (1-2 seconds) between requests to avoid hammering the server on cold hits
- Google Chat Notification — post summary to
webadminspace: total URLs warmed, any errors
Design Notes
- Use the n8n Loop node (not Split In Batches) to serialize requests and avoid overloading Apache workers
- The HTTP Request to warm cache only needs a GET — no need to process the response body
- Consider a 1-2 second delay between requests so cold misses don't stack up concurrent PHP workers
- Edge TTL is currently set to 8 days, so daily warming keeps everything well within window
- As recipes grow, workflow scales automatically since it reads from the sitemap
Validation
- After first run, spot-check 3-4 recipe URLs in browser DevTools → Network
→
cf-cache-statusshould beHIT - Monitor Google Search Console "Crawled - currently not indexed" count over the following 2-4 weeks — should decrease
Open Questions
- Confirm best time of day for the schedule (4 AM ET?)
- Decide whether to warm ALL sitemap URLs or filter to just recipe/post URLs
- Should errors (timeouts, 5xx) trigger a separate alert or just log in the summary?
Future Enhancements
- Add a check: if
cf-cache-statusis alreadyHIT, skip the URL (reduces unnecessary requests as traffic grows) - Track cache hit/miss ratio over time via a simple counter in pbs-hub
...sent from Jenny & Travis