Here’s a question for the Frontity/React experts and/or DevOps in the community:
What are the best practices for caching your Frontity website?
As a PHP and WordPress developer I’m well aware of proper caching, both on the server and client, and I know how to set it up. And one of my favorite server stacks is:
- Nginx
- Varnish
- Apache
- PHP-FPM
- Opcache
- Memcached
- Redis
And in combination with browser cache (setting cache headers), a CDN (either through Nginx or externally) and external tools like Cloudflare the client will have a lightning fast website.
However Frontity works completely different than WordPress or PHP, and since a lot of logic is handled on the client it’s not possible to handle the cache on the server (other than the REST requests to WordPress). And since none of tools above (other than Nginx) are suitable for caching static files (like the Javascripts which Frontity/React generates) I am wondering if their are other methods available to increase the speed of Frontity projects for the visitors. Not to mention that Frontity itself does not have any internal caching or packages which implement it (yet?).
I can imagine that for example implementing Redis into Frontity to cache the fetch results could be done, but I’m sure there are other, less technical, solutions.