I have an API that supports both JSON and JSONP. Obviously, being a data provider, I want the people who request my data to cache it.
However, jQuery's $.ajax() function says the following about their caching feature:
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.
Why does jQuery go out of its way to force a cashbuster when requesting jsonp? Is there a technical/philosophical reason to cachebust jsonp but not json?