开发者

How does DuckDuckGo have infinite scroll results, yet the back button functions as expected if follow a link off-site?

开发者 https://www.devze.com 2023-01-13 14:57 出处:网络
Example search results for \'apple\' on DDG: http://duckduckgo.com/apple If you scroll down a couple of times more results 开发者_JAVA百科are fetched with ajax. Then you click a link, visit the resul

Example search results for 'apple' on DDG: http://duckduckgo.com/apple

If you scroll down a couple of times more results 开发者_JAVA百科are fetched with ajax. Then you click a link, visit the result, click the back button, and the DDG page is exactly as you left it.

How?


I noticed that the d.js file is appended to on the page and it contains all of the result links. Could this be how they do it?

If all links are loaded from the JS file and your currently cached version of the JS is the last (largest) page of links, that would allow all results to remain. Not sure how they are forcing cache of the d.js file since it contains a query string though.

0

精彩评论

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