sydevs / WeMeditate

International website promoting the practice of meditation, with online resources and free local classes.
https://www.wemeditate.com
5 stars 7 forks source link

Implement Cloudflare Page Caching #143

Open Ardnived opened 2 years ago

Ardnived commented 2 years ago

Apart from initial implementation time I don't see a lot of cost.

Downsides would be:

  • Risk of bugs in cache purge logic causing changes not to immediately propagate
  • Disabling the rails session cookie could confuse junior developers working with forms which could end up raising invalid authenticity token errors on submit. But as this kind of error would occur already in the development environment stage, I'd argue that it sorts itself out quite naturally Upsides would be:
  • Massively improved global website performance
  • Improved SEO due to performance being part of web vitals

I checked out the plan requirements for the "bypass cache on cookie" feature, looks like that's only enabled for Business plans and above (minimum $200/month) so probably not viable in our case. This would only be an issue if we have pages with personalized content though, which IIRC we don't have?

Follow-up to the discussion in this ticket https://github.com/sydevs/WeMeditate/issues/125

Ardnived commented 2 years ago

I've recently learned that only 4.6% of our pages are considered to have a "good page experience" by Google. Which means passing their "Core Web Vitals" test. I understand this can affect search ranking, and when I looked at the analysis it looks like the most significant factor is the initial server response time (almost 1s of load time).

One option would be to increase our Heroku dyno sizes, but CloudFlare caching would probably a far superior solution.