Wednesday, 2 October 2013

Output cache not working for AJAX varyByParam

Output cache not working for AJAX varyByParam

I have an endpoint for a WCF web service which is not getting output cache
hits in the performance monitor for AJAX requests, it does get an output
cache for non AJAX requests to endpoint.
Web config:
<caching>
<outputCacheSettings >
<outputCacheProfiles>
<add location="Any" name="myCache" duration="3600" varyByParam="*" />
</outputCacheProfiles>
</outputCacheSettings>
</caching>
Is there an option I'm missing in the config? I've not included Javascript
because I doubt the problem lies there since the server shouldn't have to
check any headers to determine cache worthiness.
The endpoint:
[AspNetCacheProfileAttribute("myCache")]
[WebGet(ResponseFormat= WebMessageFormat.Json, BodyStyle =
WebMessageBodyStyle.Bare, UriTemplate =
"suburb?name={name}&state={state}&category={category}&bedrooms={bedrooms}&country={country}")]

No comments:

Post a Comment