Search code examples
vue.jsvuex

What's the maximum data that vuex can store?


I have a blog app using vuex to store the post data that users have visited so that if they visit the same post again they don't need to fetch the data from the server again.

Is it a good idea to store all those post data in vuex?

Will it slow down the app?

Are there any memory leak issues with this approach?


Solution

  • Your store is held completely in memory. That means you have as much storage available as the user device allows you to use memory.

    Most apps stay around 30-100 MB memory usage. You should try to stay in this range as well (nobody likes insanely memory hungry apps that slow down your computer).

    That being said, you probably fetch your blog posts from a server. Hence, your browser will be able to just cache these requests so he does not have to load them again.

    What you should look into instead is how to set up a browser cache policy. This is set in the headers of your server response as 'exipres' header.