... ...">

ASP.Net: Is it possible to cache js proxies generated by scriptmanager?

We have the following code:

    <asp:ScriptManager runat="server">
       ...

    <Services>
        <asp:ServiceReference Path="~/JSONServices/ProfileService.svc" />
    </Services>
        ...

      

This results in a Javascript proxy that is located at /JSONServices/ProfileService.svc/js. This Javascript has content expiration set at the same time it was called (so it is never cached on the client). Is it possible for clients to cache these proxies for some time?

+1


source to share


1 answer


So we finally looked at it again and we ended up with the following:

  • created a new httphandler that runs inn for all requests in * .cachedsvc format
  • in the module, forward the request to the * .svc path (where the real proxy is located) and cache the result from the built-in .svc handler for a set time.


seems to do the trick.

All we have to do is specify the caching paths in our script managers instead of the actual .svc path (the editor calls it as a bug, but it works like a charm)

+1


source







All Articles