开发者

going to next page using django paginator sends request again.

开发者 https://www.devze.com 2023-01-15 12:48 出处:网络
My google search ap开发者_StackOverflow中文版plication making a request each time while i am using paginator. Suppose i have a 100 records. Each page have to show 10 records so ten pages. When i click

My google search ap开发者_StackOverflow中文版plication making a request each time while i am using paginator. Suppose i have a 100 records. Each page have to show 10 records so ten pages. When i click 2nd page it again sending a request. Ideally it should not send the request.


When i click 2nd page it again sending a request. Ideally it should not send the request.

What do you mean by request? Is it a request to Google?

Your application apparently does not cache the results. If your request to Google returns 100 pages then you should cache those hundred. When you request the second page the view should retrieve this cache and return the second page to you.

If you mean request to your app, then @Daniel's comment has it right. You can get around this by sending all the results to the browser and then do the pagination using JavaScript to avoid this.

A more detailed answer is difficult without seeing some code.

0

精彩评论

暂无评论...
验证码 换一张
取 消