Custom JavaScripts From WebCenter Portal FrameWork Application Cannot be Cached by OHS Directives Because of Incorrect or Missing Content-Type in HTTP Response Headers. (Doc ID 1614674.1)

Last updated on MARCH 08, 2017

Applies to:

Oracle WebCenter Portal - Version 11.1.1.7.1 and later
Information in this document applies to any platform.

Symptoms


From JDeveloper, create a  WebCenter Portal FrameWork Application.  In the same location where index.html is, create a custom javascript file (.js).

Access the javascript from browser:  e.g. http://machine:port/<app_contaxt>/javascript_name.js

Use HTTP IE Headers or Live Headers (or equivalent) to look at the response http headers in the  browser.

Notice that the content-type is not there.



If the application is front-ended by Oracle HTTP Server (OHS),  access to the javascript via OHS will show the response as

content-type is text/plain   instead if   application/x-javascript


As a result, the javascript cannot be cached using OHS directives (e.g.) :

   ExpiresActive On
   ExpiresByType  application/x-javascript "access plus 1 minute"

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