Hello,

We are trying to utilize TS cache for the responses from our web
service. We seem to have either a configuration issue or an HTTP header
mismatch or..well, we need your help:)  basically, in the below
scenario, if I change the Accept: header to include "application/*" or
specifically "application/json" (e.g. Accept: text/*, text/html,
application/json) then it becomes a cache hit on TS and the origin
server is not called. I tried setting the vary headers and alternates
but nothing worked. Unfortunately, we don't have control over the
calling server, which is a middle man between the end user and us, and
it sends the Accept: header in the request but our response is
application/json which gets transmitted through this middle man back to
the caller.

Here are some excerpts from TS logs..

Here is the incoming request after it's mapped by TS:

+++++++++ Incoming Request +++++++++
-- State Machine Id: 307
User-Agent: curl/7.21.2 (x86_64-unknown-linux-gnu) libcurl/7.21.2
OpenSSL/1.0.0c zlib/1.2.5 libidn/1.15 libssh2/1.2.7
Host: xxx.com
Accept: text/*, text/html

and it finds bunch of alternates after this point, but it doesn't return
any of them.. and here is the response from the origin server:

+++++++++ Incoming O.S. Response +++++++++
-- State Machine Id: 307
HTTP/1.1 200 OK
Date: Thu, 03 Nov 2011 23:33:45 GMT
Content-Length: 1003
Cache-Control: public,max-age=565
Vary: Accept-Encoding
Connection: close
Content-Type: application/json; charset=UTF-8

and, if the incoming request had "Accept: text/*, text/html, application/*",
then TS returns a cache hit rather than contacting origin server.
Is there a way to force caching even if the "Accept:" header does not
contain the response "Content-Type" or may be something is not
configured correct?

Thank you for all your help.
-Gokce


Reply via email to