« How-to use Contextual Events in ADF Region interaction | Main | ADF Code Corner: How-to pass values from a parent page to a popup dialog »
New ADF Faces Caching filter in JDeveloper 11g R1 Patch Set 1
By frank.nimphius | November 3, 2009
As a note to myself, so I don't forget about this new (late arrival) feature that becomes available in the upcoming JDeveloper 11g R1 Patch Set 1 release:
ADF Faces Rich Client provides a caching filter that allows you to write gzip compressed content to the client.
AdfFacesCachingFilter
The new AdfFacesCachingFilter marks the application resources for caching at external Web Cache and/or user-agents (browsers). It also provides functionality for compression, in which a gzip-compressed response is sent to the user-agent. Advantage with this filter is that application developers don't need to configure Web Cache for this filter to work.
Only caching-rules need to be configured for the resources in application's adf-config.xml file. Caching-rules are based on file extension or path prefix. ADF faces jars comes with the default caching-rules for it static resources. If application developer defines their rules in adf-config.xml and their rules takes precedence over the default rules in jar.
The filter must be configured in web.xml if you want to use it. It also must be the first filter in the chain of filters:
-
<filter>
-
<filter-name>ACF</filter-name>
-
<filter-class>oracle.adf.view.rich.webapp.AdfFacesCachingFilter</filter-class>
-
</filter>
-
<filter-mapping>
-
<filter-name>ACF</filter-name>
-
<url-pattern>*</url-pattern>
-
</filter-mapping>code]
Caching-rules are defined in adf-config.xml. Following codes shows the example caching-rules for all the js and jpeg files to be cached and/or compressed at Web Cache and user-agents:
-
<adf-faces-config xmlns="http://xmlns.oracle.com/adf/faces/config">
-
<caching-rules>
-
<caching-rule id="cache js">
-
<cache>true</cache>
-
<compress>true</compress>
-
<duration>99999</duration>
-
<agent-caching>true</agent-caching>
-
<cache-key-pattern>*.js</cache-key-pattern>
-
</caching-rule>
-
<caching-rule id="cache jpeg">
-
<cache>true</cache>
-
<compress>false</compress>
-
<duration>99999</duration>
-
<agent-caching>true</agent-caching>
-
<cache-key-pattern>*.jpeg</cache-key-pattern>
-
</caching-rule>
-
</caching-rules>
-
</adf-faces-config>
Frank
Topics: ADF Faces RC | No Comments »
Comments are closed.
