Why does jQuery.ajax() add a parameter to the url?

后端 未结 2 2082
温柔的废话
温柔的废话 2020-11-29 08:46

I have a data fetching method that uses jQuery.ajax() to fetch xml files.

/*    */data: function() {                                                    


        
2条回答
  •  猫巷女王i
    2020-11-29 09:02

    That is a 'cache-buster' and is ignored.

    The added parameter changes the url just enough to bypass most all caches that are between you and the source.

    If the Url was not modified, it is likely that data would be served from any one of the caches between you and the resource, including your browser, any proxies, and perhaps the server itself.

    You can find a lot of explanations on the net. Here is one.

提交回复
热议问题