This example Devvit project showcases the recommendations from Optimize Performance
In this app there are three separate examples which showcase best practices with using the cache, making async requests to external services, and using realtime to share data when events occur.
This example showcases how to utilize the useAsync hook to make data requests without blocking your requiring these values to return before continuing (blocking).
This example showcases how to utilize a cache helper to make one request for data, save the response, and provide this response to all users requesting the same data. The cache lives at the Reddit level (not the app level). A random user will be selected to make the request and the data will be shared with others.
This example showcases how to share data efficiently between users using realtime. This allows you to subscribe to updates to data changes rather than needing to poll for data changes in an interval.
git clone ....
cd ...
npm installContinue by following along with the Quick Start guide on the Devvit documentation site
