Who Add “_” Single Underscore Query Parameter?

后端 未结 5 1365
一个人的身影
一个人的身影 2020-12-01 08:47

I have a PHP server running on Apache, I get lots of request looks like this,

10.1.1.211 - - [02/Sep/2010:16:14:31 -0400] \"GET /request?_=1283458471913&         


        
5条回答
  •  渐次进展
    2020-12-01 09:27

    1283458471913 is a unix timestamp in ms, probably a bot/proxy making sure that they get a fresh page and not a cached version.

    Could also be jQuery which would cause this for AJAX request of you have the nocache attribute set to true.

    if ( s.cache === false && type == "GET" ) {
        var ts = now();
        // try replacing _= if it is there
    
        var ret = s.url.replace(/(\?|&)_=.*?(&|$)/, "$1_=" + ts + "$2″);
        // if nothing was replaced, add timestamp to the end
    
        s.url = ret + ((ret == s.url) ? (s.url.match(/\?/) ? "&" : "?") + "_=" + ts : "");
    }
    

提交回复
热议问题