sedaily-front-end
sedaily-front-end copied to clipboard
Better Caching
I know that we use Prerender. Can we do some more eager rendering and caching of the main homepage so that it loads more quickly?
@sterlingrules What caching do we need to avoid the loading wheel on page load?
@crablar There are a bunch of little things I believe we can do. We can start by assessing requests and just making sure we're not making any unnecessary data calls. Then we can improve the server by leveraging memcache
and redis
. We can also improve the frontend by leveraging client-side storage via vuex-persist
.
What would we cache in redis? What would vuex-persist do?
In Redis, we could cache expensive requests. Possibly the posts feed, user profiles, or topic pages. Whatever sort of request that would have multiple database queries. Heroku provides a Redis add-on. vuex-persist
is similar to redux-persist
in that it would cache the client-side application state in localStorage
. For example, data — even if out of date — could be shown immediately while new data was being fetched.