views:

246

answers:

1

We have the following code:

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

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

This results in a javascript proxy found in /JSONServices/ProfileService.svc/js this javscript has content expiry set to the same time it was called (so it is never cached on the client) Is it possible to have the clients cache these proxies for some time?

Yours Andreas

+1  A: 

So we finally got around to looking at this again, and we ended up with the following:

  • created a new httphandler that kicks inn for all requests in format *.cachedsvc
  • in the module, forward the request to the path *.svc (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 then need to do is to specify the cacheable paths in our scriptmanagers instead of the real path of the .svc (editor flags it as a bug naturally, but it works like a charm)

AndreasKnudsen