Specific Caching concerns for ScriptResource.axd Requests

599 Views Asked by At

In ASP.NET, the ScriptResource.axd handler takes query string parameters d and t in the form of:

ScriptResource.axd?d=_hSUKSQdvAs7dxQgs9-PDrSiKiE0c9O5zvO0sj4yZ2QLo6tYqKk_bwwraYR04nIr3PC67krX9TJ74PqE3GLbGf5zgbmzm86AbQTJO_njhxV9HYTO0MUc2Q9MJgc1xDU2aS_17TjxLvUtjkkzQ61REg2&t=ffffffffae5faa5e

Are all calls to that specific URL with those specific parameters guaranteed to return the same exact content? If not, when can it change?

Or, to put it more generally, is there any reason why a browser cache should treat AXD files differently than any other file type?

1

There are 1 best solutions below

0
On

the ScriptResource.axd handler takes query string parameters d and t

These params refer to encrypted data transferring: https://referencesource.microsoft.com/#System.Web.Extensions/Handlers/ScriptResourceHandler.cs,770 https://referencesource.microsoft.com/#System.Web.Extensions/Handlers/ScriptResourceHandler.cs,286

Are all calls to that specific URL with those specific parameters guaranteed to return the same exact content? If not, when can it change?

In general, the returned content should be same, however, it depends on the https://referencesource.microsoft.com/#System.Web.Extensions/Handlers/ScriptResourceHandler.cs,998714d467da2852,references consumers.

The caching strategy https://referencesource.microsoft.com/#System.Web.Extensions/Handlers/ScriptResourceHandler.cs,504 depends on the https://referencesource.microsoft.com/#System.Web.Extensions/Configuration/ScriptingScriptResourceHandlerSection.cs,a75bc41405c5ac33 settings.

Or, to put it more generally, is there any reason why a browser cache should treat AXD files differently than any other file type?

I believe that you can force caching by enabling the aforementioned https://referencesource.microsoft.com/#System.Web.Extensions/Configuration/ScriptingScriptResourceHandlerSection.cs,70 option.

P.S. Is it a content of the postback/callback (WebForm_DoPostBackWithOptions, WebForm_DoCallback, etc.) scripts, a response from the ScriptManager async request, etc.