Add Expires Headers to your APEX Application

Probably the best book I have ever read about apex is Expert Oracle Application Express by several knowledgeable authors. You should buy it if you don’t already did.

The first chapter from John Edward Scott is about some of the well known architectures of an Apex implementation and its configuration. This chapter made me use the YSLOW Add-on for Firefox/firebug on our website and it came up with this following picture:
yslow-before picture

Not a pretty picture indeed.

First I wanted to get ride of the expires headers error.

I created a modexpires.conf Apache configuration file with the following content and included it in our HTTPD-configuration.

ExpiresActive On
ExpiresByType image/gif “access plus 15 days”
ExpiresByType image/jpeg “access plus 15 days”
ExpiresByType image/jpg “access plus 15 days”
ExpiresByType image/png “access plus 15 days”
ExpiresByType image/x-icon “access plus 15 days”
ExpiresByType application/x-javascript “access plus 7 days”
ExpiresByType text/javascript “access plus 7 days”
ExpiresByType text/css “access plus 7 days”
FileETag none

The morning after picture on Expires Headers is much prettier:
Yslow expires headers after picture

Next step will be compression. But that’s another blog.

Like I said. Read the book!


Some older OHS/Apache versions don’t seem to support the alternate syntax used above. Instead you should use the <code>seconds notation.

ExpiresActive On
ExpiresByType image/gif A1209600
ExpiresByType image/jpeg A1209600
ExpiresByType image/jpg A1209600
ExpiresByType image/png A1209600
ExpiresByType image/x-icon A1209600
ExpiresByType application/x-javascript A604800
ExpiresByType text/javascript A604800
ExpiresByType text/css A604800
FileETag none


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.