freeCodeCamp/news

Remove NGINX Cache to prevent stale content

raisedadead opened this issue · 1 comments

Currently, we use the inbuilt caching features of NGINX on our web servers. These work perfectly fine because we have Ghost doing the invalidation (when NGINX checks for updated content) for a given page. Then on Cloudflare's dynamic caches handle the rest, and the setup is decently good.

But with the new SSG based news, we have all the paged pre-rendered and readily available. This brings in the additional overhead of doing cache invalidation.

In future, we may be able to do just that by listening to Ghost for changes and with 11ty's upcoming hybrid builds - but while that happens it's best we completely remove the NGINX caches because we no longer need them (although the cache would make the pages faster).

As an interim solution, I believe we can add a Varnish Cache layer instead.

I have decided that we need to observe and bust the cache with either an varnish implementation or something else.