Url requests get to add a random number as a parameter

Ajax requests URL with random number principle

for example:

$.ajax({
            type: "GET",
    url: "login.action?ran="+getRandomNum() 
});
Url in

is followed by a random number to deceive browsers or proxy servers.

my question is if the url you generate is

login.action?ran=39525

only login.action on the server side does not have this login.action?ran=39525
Why does the server use login.action as a reply and does not report an error?

May.10,2021

  • login.action is a backend route.
  • ran=39525 is a routing parameter.

the server only needs to match the corresponding route to process the request, and the parameters can be passed anything.


in a get request, a random number is added to the address query string parameter to avoid the browser caching the previous request for the result.
query string does not affect the access of uri, but may affect the result of the request depending on the business logic.

login.action?ran=39525
what is actually emitted by the browser is

GET /?ran=39525 HTTP/1.1

Host: login.action
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3c28f-2c2f7.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3c28f-2c2f7.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?