Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Here is my idea, the goal is to cache the results of your CargarHoteles() hotels function. Because you are caching it you can have a background process do the work while the user interface responds quickly.</p> <p>When the client first asks for information about a set of parameters the service return a unique id for that set of parameters (it looks to see if it is already in the cache and returns that if it exists). When the client gets the unique id it starts asking the server for some results -- if they are already in the cache they come back right away -- or a subset comes back with an indication of how much of the search is done.</p> <p>On the server side you have a worker process (or processes -- this solution allows you to toss more machines/process at the task if there is a good way to do so, for example a task for every xml file.) These workers are solving the problem and putting the results in the cache, when they are done they flag that cache item as finished. The next time the client requests more information it learns it has all the results.</p> <p>Note that this design is compatible with Marc's suggestion, that is the queue he talks about is the results which are being built as an entry in the cache. </p> <p>One of the nice features of this solution is if there is a lot of interest in one location (everyone is going to the Olympics!) your website gets faster.</p> <p>I hope this is clear. Post questions if it is not and I will try and explain more.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload