CachedServiceClient and last-modified

You can run that code locally. There’s nothing special about it. That said, that’s not how the specs for NoCache say it should work. NoCache should cached on the client but only be used when 304 is returned.

No-Cache

“Forces caches to submit the request to the origin server for validation before releasing a cached copy.”

Without this implementation, how else could you possibly deal with 304 responses? It has to be cached but only used with the reply is 304. That’s how a browser treats it. And works as expected using a browser. As per a previous thread here where a chance allowed 304s to work as expected with browsers.

Additionally, I’ve also found that the CachedHttpClient isn’t using consistent url encoding. During debug, the _OnResultsFilter will have a

requestUri http://localhost:1337/json/reply/CacheGetTwoRequest?lastModifiedReturnDate=2018-02-26T15%3A42%3A02.7927173Z&AuthSecret=mocking

where the OnRequestFilter uses webReq.RequestUri.ToString() which is actually
http://localhost:1337/json/reply/CacheGetTwoRequest?lastModifiedReturnDate=2018-02-26T15:42:02.7927173Z&AuthSecret=mocking

and thus would never find the cached result in the dictionary anyway.