Search code examples
javascripthtmlhttpgetquery-string

What purpose is of "&rnd=" parameter in http requests?


Why do some web-applications use the http-get parameter rnd? What is the purpose of it? What problems are solved by using this parameter?


Solution

  • This could be to make sure the page/image/whatever isn't taken from the user's cache. If the link is different every time then the browser will get it from the server rather than from the cache, ensuring it's the latest version.

    It could also be to track people's progress through the site. Best explained with a little story:

    1. A user visits example.com. All the links are given the same random number (let's say 4).
    2. The user opens a link in a new window/tab, and the link is page2.php?rnd=4. All the links in this page are given the random number 7.
    3. The user can click the link to page3.php from the original tab or the new one, and the analytics software on the server can tell which one by whether it has rnd=4 or rnd=7.

    All we can do is suggest possibilities though. There's no one standard reason to put rnd= in a URL, and we can't know the website designer's motives without seeing the server software.