I am using Oracle's ORDS 20.2 which has jetty/9.4.28.v20200408 embedded, APEX 20.1, Database 18c XE, Google Chrome Version 84.0.4147.135 (Official Build) (64-bit), opera Version:70.0.3728.106 and Windows 7 Ultimate.
In APEX there is a directory that has APEX's static files - CSS and Javascript files and image files. I need to enable gzip for that directory and tell the browser to cache it for at least 12 hours in order to improve performance for APEX development environment and my APEX applications according to Oracle's documentation here, https://docs.oracle.com/en/database/oracle/application-express/19.2/htmig/performance-optimization-tasks.html#GUID-668ED330-AFDC-4A43-AA11-D67FCCA58DA1
I've created a folder named "etc" under the "standalone" folder of my ORDS configuration directory. That's the folder where I should put any Jetty's Xml configuration files. Then created a file called "jetty.xml" with the following contents to implement what is in the Jetty's documentation about sending Cache-Control header, https://www.eclipse.org/jetty/documentation/current/header-filter.html And
<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN"
"http://www.eclipse.org/jetty/configure.dtd">
<filter>
<filter-name>HeaderFilter</filter-name>
<filter-class>org.eclipse.jetty.servlets.HeaderFilter</filter-class>
<init-param>
<param-name>headerConfig</param-name>
<param-value>
"add Cache-Control: max-age=43200"
</param-value>
<init-param>
<param-name>includedPaths</param-name>
<param-value>
"D:\ords\images"
</param-value>
</init-param>
</filter>
But when I run ORDS through a batch file which has
cd D:\Original\Oracle_ORDS_Editions\ords-20.2.0.178.1804
d:
java -jar ords.war standalone
the cmd window opens then vanishes automatically. I need to know why the code fails and still need to enable gzip for that directory. Thank you.
The
HeaderFilteris for use with webapps that are traditionally deployed via a webapp archive (WAR file).The documented configuration for
HeaderFilteris for the war internalWEB-INF/web.xmlservlet descriptor that is specific to the webapp being deployed (typically found within a WAR file).Arbitrarily creating
etcdirectories andjetty.xmlfiles are never a relevant form of configuration for Jetty.The
etcdirectory and thejetty.xmlconcepts are only relevant if you are using the standalone Jetty techniques (such as what's seen injetty-homeor the olderjetty-distributionarchives). More specifically, thestart.jarwithin thejetty-homearchive is the only one that looks for and uses either theetcdirectory or thejetty.xmlfile.The
jetty.xml, that thestart.jaris aware, of is never managed by manually creating it or editing it. In fact it's a typically a read-only file that comes with thejetty-homearchive, and is used in-place. Theetcdirectory is found within thejetty-homearchive, and can also be seen in the application specific configuration of Jetty standalone known as the${jetty.base}directory.You mentioned "jetty/9.4.28.v20200408 embedded" which typically means it's not using the standalone Jetty concepts. In an embedded Jetty scenario, the configuration of the Jetty server is typically done within the configuration techniques of the parent project (Oracle ORDS in your case). You'll need to know how that Jetty server is configured, and work within the limits of whatever configuration that parent project provides to you.