'OTD DOES NOT CACHE IF THERE IS NO "LAST-MODIFIED" HEADER' In the Response Header When Using Oracle Traffic Director 11.1.1.7.0 (Doc ID 1995403.1)

Last updated on APRIL 06, 2017

Applies to:

Oracle Traffic Director - Version 11.1.1.7.0 to 11.1.1.7.0 [Release 11gR1]
Information in this document applies to any platform.

Symptoms

When OTD is configured to use proxy cache the content is not cached if there is no "Last-Modified" header in the response. For example:

<If $uri =~ "/demo_page">
ObjectType fn="proxy-cache-config" id="cache-rule-1" enabled="true" min-object-size="1" min-reload-interval="60" max-reload-interval="120"
NameTrans fn="assign-name" id="route-2" name="route-2"
</If>


Send a request:


curl -v http://x.x.x.x/demo_page/emxLogin.jsp  

[2014-12-05T16:16:28-05:00] [net-v1] [NOTIFICATION:1] [OTD-11008] [] [ecid: 05400050000000000] [rid: 0] [pid: 27994] for host x.x.x.x

trying to GET /demo_page/emxLogin.jsp, service-http reports: request headers sent to origin server(x.x.x.x) :
[[ GET /demo_page/emxLogin.jsp HTTP/1.1
Proxy-agent: Oracle-Traffic-Director/11.1.1.7
ECID-Context: 1.05400050000000000;kXjE
Surrogate-capability: otd="Surrogate/1.0"
User-agent: curl/7.39.0 Host: x.x.x.x
Accept: */* Client-ip: x.x.x.x
Proxy-ssl: False
X-forwarded-for: x.x.x.x
Via: 1.1 net-v1
Connection: keep-alive ]]


Response:


[2014-12-05T16:16:28-05:00] [net-v1] [NOTIFICATION:1] [OTD-11009] [] [ecid: 05400050000000000] [rid: 0] [pid: 27994] for host x.x.x.x

trying to GET /demo_page/emxLogin.jsp, service-http reports: response headers received from origin server(x.x.x.x) :

[[ HTTP/1.1 200 OK
 x-powered-by: JSP/2.1
 server: Sun GlassFish Enterprise Server v2.1.1 Patch22
 set-cookie: JSESSIONID=c4fa0e218d6fb72c62c03c5c401f; Path=/
 content-type: text/html;charset=ISO-8859-1
 content-length: 160]]


Proxy cache shows:
 
1. /v1/demo_page/emxLogin.jsp    hits 0    flags ICP    refs 0    age 17   modified 20141205161628    size 160    fileid [3119817148, 21]
 
You get a 200 which is expected on first request/response and file is placed in cache. NOTE: There is no "last-modified" header being sent from backend server. As a result, OTD is setting "modified" to the current time of OTD server.


 
Send a 2nd request:
 
$ curl -v http://x.x.x.x/demo_page/emxLogin.jsp
 
[2014-12-05T16:16:59-05:00] [net-v1] [NOTIFICATION:1] [OTD-11008] [] [ecid: RG100080000000000] [rid: 0] [pid: 27994] for host x.x.x.x

trying  to GET /demo_page/emxLogin.jsp, service-http reports: request headers sent to origin server(x.x.x.x) :
[[GET /demo_page/emxLogin.jsp HTTP/1.1
Proxy-agent: Oracle-Traffic-Director/11.1.1.7
ECID-Context: 1.RG100080000000000;kXjE
Surrogate-capability: otd="Surrogate/1.0"
User-agent: curl/7.39.0
Host: x.x.x.x
Accept: */*
Client-ip: x.x.x.x
Proxy-ssl: False
X-forwarded-for: x.x.x.x
Via: 1.1 net-v1
Connection: keep-alive]]


Response:


[2014-12-05T16:16:59-05:00] [net-v1] [NOTIFICATION:1] [OTD-11009] [] [ecid: RG100080000000000] [rid: 0] [pid: 27994] for host x.x.x.x

trying  to GET /demo_page/emxLogin.jsp, service-http reports: response headers received from origin server(x.x.x.x) :
[[HTTP/1.1 200 OK
x-powered-by: JSP/2.1
server: Sun GlassFish Enterprise Server v2.1.1 Patch22
set-cookie: JSESSIONID=c501ab9c7804607637ad9a2c42ae; Path=/
content-type: text/html;charset=ISO-8859-1
content-length: 160
date: Fri, 05 Dec 2014 21:16:59 GMT]]



Proxy cache:
 
1. /v1/demo_page/emxLogin.jsp    hits 0    flags ICP    refs 0    age 82    
modified 20141205161659    size 160    fileid [3119817148, 22]
 


You can see that file in the cache is replaced, as a result the cache is not being utiziled and the "hits" stay at 0. The expected behavior is for the file to be retrieved from the cache on subsequent requests. This can cause performance degradation. You see the same behavior if "if-modified-since" header is sent with a time that is earlier than the "modified" time in the cache.
 
A note that if a "if-modified-since" header is sent with a time that is later than the "modified" time in the cache you will get a 304 which tells the browser to serve content from it's local cache. This last part is expected behavior.
 
If a "last-modified" header is sent in the response or added via the OTD configuration then the proxy cached behaves as expected. The content is
retrieved from origin server on first request and subsequent requests are retrieved from proxy cache.

 

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms