Answer the question
In order to leave comments, you need to log in
Replace data or cache, how does the amount of stored data in the Store affect performance?
For example, there is a list of 100 posts.
When a user clicks on a post, ajax requests are made to get data about a particular post.
The question is, can you cache at the Store level in the form
post_list_with_full_data:
{
{
id: 5,
title: 'FIRST VISITED POST',
description: 'Some very long description, displayed only on post info page,
images: {{url: 'some_attachment_url'}, {url: 'some_attachment_url'}, {url: 'some_attachment_url'}},
comments: {{comment: 'long comment, only on full info page'}, {comment: 'long comment, only on full info page'}},
...
},
{
id: 25,
title: 'FIRST VISITED POST',
description: 'Some very long description, displayed only on post info page,
images: {{url: 'some_attachment_url'}, {url: 'some_attachment_url'}, {url: 'some_attachment_url'}},
comments: {{comment: 'long comment, only on full info page'}, {comment: 'long comment, only on full info page'}},
...
},
...
}
current_post:
{
id: 2,
title: 'SECOND POST'
...
}
Answer the question
In order to leave comments, you need to log in
Storing data in a store makes sense in many cases. But this is not one of them. There are several much better tools for caching network requests. First Cache API , second Service Worker API and Workbox . All of these methods use the browser's built-in cache for storage. Which gives a number of advantages:
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question