How is the data returned by ajax saved / cached?

1. Because the page uses a template engine three times, ajax requests data from the same interface three times.
2. Since they all belong to the same interface, I want to request the interface once and cache the data, and then let the template engine get the cached data.
3. Can it be implemented in jq?


declares a global variable, assigns a value to it, and then caches


can be stored in localStorage. If you don't delete it actively, you won't delete it.
can refer to the following.
https://www.cnblogs.com/st-le.


es6 map structure has been cached before

Menu