D
D
dev4002016-08-12 16:52:28
PHP
dev400, 2016-08-12 16:52:28

Why is such a strange get parameter added on ajax request?

https://xxxxxx.ru/asdasdasd_handler.php?param1=fdfdf&param2=43fgdfg5&_=1471009669397


and finally 404 (Not Found)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
trushka, 2016-08-12
@dev400

jQuery adds the _={timestamp} parameter to prevent the browser from caching the request. In theory, on the server, the "left" parameters should be ignored
api.jquery.com/jQuery.ajax

cache (default: true, false for dataType 'script' and 'jsonp')
Type: Boolean
If set to false, it will force requested pages not to be cached by the browser. Note: Setting cache to false will only work correctly with HEAD and GET requests. It works by appending "_={timestamp}" to the GET parameters. The parameter is not needed for other types of requests, except in IE8 when a POST is made to a URL that has already been requested by a GET.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question