How to increase AJAX performance

I am developing an image / profile search application that is based almost exclusively on AJAX. The main page basically displays profile images and allows the user to filter / search and paginate them.

Pagination works when the user scrolls, so the interface should be very fast . Only 6 (maybe 9, but definitely no more) images will be displayed on the main page, so users will scroll a lot. Currently, I use a very simple JS cache to store the results of all requests in case the user decides to return ... in this case, I just pull everything out of the cache instead of the server request.

Client cache

One of the options I was thinking about is preloading, says 10 pages in front and saves them in the cache.

But my biggest problem is filtering / searching , as this completely changes the type of request that arrives at the server. My filters are not very complicated, only about 6-7 attributes are string / number / enum.

Now, if I wanted to do all the filtering in the cache, I would have to duplicate all the search logic and retrieve all the data from the server (and not just the data that I show), so I could filter the results on the client side.

This begs the question, should I make the cache somehow stubborn? Store it in a cookie?

Server cache

memcached . , , AJAX.

Rails 3, , , . , , Rack/Sinatra AJAX. , AJAX.

S3 ?

- , ( ).

. VPS 200 , ( ). . , S3 , ? 100x150px, 50 .

+3
1

SlickGrid. , , , .

+2

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


All Articles