Use .js files to cache large dropdowns

I would like to keep the contents of large user interface lists cached on the client and be updated according to criteria or regularly. The client code can then simply populate the drop-down lists locally, avoiding lengthy page loads.

These lists may be close to 4k elements, and dynamically filtering them without caching will lead to several rather large round trips.

How can i do this? I mean, which templates and strategies are suitable for this?

+3
source share
4 answers

JSON , JS URL-, , . :

/media/js/ac.js?1234ABCD

, .

/media/js/ac.js?4321DCBA

, , URL-, 304 Not Notified ( , ). , , , "" , .. JS , , 304, 200.

ac.js , , , JS.


, , . - memcached server-side gzip compression, , . (, ), .

+2

Combres - - js , , URL- .

http://combres.codeplex.com/

+1

If its fair text data, you have enabled compression on a web server and have less than 100 elements, then it may not be necessary to maintain lists in the client script.

It’s usually best to put all your data (list items - data) in one place, so you don’t have to worry about synchronization.

0
source

Source: https://habr.com/ru/post/1744828/


All Articles