« Home | Configure Oracle Application Server Logs » | Oracle Application Server Default Log » | Oracle Application Server Won't Start » | Is God Unfair ? » | God is Good » | My Life as a Roomer » | English is extremely important for programmers » | Balicamp Training Finished » | First Step To Balicamp » | Rangkuman Peopleware - Bagian 5 (finish) »

Oracle Application Server Cache Setting

We can add header setting in Oracle Application Server to force javascript / image being cached in browser. We can determine the expired date of this cached files. When the cached is not expired yet, the browser will never check for newer version in server. So this setting will speed up time for delivering response page to user.

We can configure this setting in file c:\product\10.1.3.1\OracleAS_1\Apache\Apache\conf\httpd.conf. We could add these lines to httpd.conf to cache gif, jpg, js, and css files:
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/gif "access plus 10 years"
ExpiresByType image/jpg "access plus 10 years"
ExpiresByType text/js "access plus 10 years"
ExpiresByType text/css "access plus 10 years"
</IfModule>

Some another examples for configure expired period are:
ExpiresByType image/gif "access plus 3 months"
ExpiresByType image/gif "access plus 3 weeks"
ExpiresByType image/gif "access plus 3 days"
ExpiresByType image/gif "access plus 3 hours"
ExpiresByType image/gif "access plus 3 minutes"
ExpiresByType image/gif "access plus 3 seconds"

Important Note: if we already set the expired header for a long period, than we have to change the filename when we modify file content. Because if we still using the same filename and the cache is not expired yet, than browser always pick the file from cache, and not trying to get a newer version from server.