Answer the question
In order to leave comments, you need to log in
Cache page with data?
There was a need to use caching. The essence of the problem, there is a user profile in which there is a table with dynamic data (updated once or twice a day). When you enter the profile, this data is updated and the page is loaded for about 3-5 seconds. In this regard, the idea came to make the "Update" button, as a result of which the data will be requested as needed by the user, but before that they should remain unchanged. Actually a question how it is better to organize caching? And yes, the data is taken from the API, and is not stored on the server.
Answer the question
In order to leave comments, you need to log in
Can be cached on the server side:
1. to a file. (cheap, fairly fast, the good old way)
2. in memory. (more expensive, but faster. There are special daemons/plugins/systems like memcache or redis)
3. to the database
4. to the session (if there is a lot of data, this is not the best option. Especially considering that the session itself is stored in one of the first three storages)
On the client, you can cache in localstorage, for example.
The choice of the best caching will depend on how many visitors you have, and how much data.
The easiest option is to file.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question