Controlling Content Cache by Mime Type?

I'm trying to control the application of the "Cache-control" response header based on the mime type of the resource requested. For instance I want to only set it for only static, not dynamic (i.e. JSPs/servlets) content.

Have figured out how to set it for all content by adding the following:

PathCheck fn="set-cache-control" control="private,max-age=3600"

But how can a restrict it to certain mime types such as "image/*" or "application/x-*"?

I suspect an new Object is needed, but can't figure out how to invoke it by mime type:

<Object name="cache-static">

PathCheck fn="set-cache-control" control="private,max-age=3600"

Service fn="send-file"

</Object>

Any help would be apprciated.

[763 byte] By [bmcgowanvz] at [2007-11-26 11:19:17]
# 1

Unfortunately, you won't be able to use a PathCheck directive. The MIME type hasn't yet been determined when the PathCheck directives execute.

If you're using Sun ONE Web Server 6.1 or later, you could add the following to the default Object:Output type="(image/*|application/x-*)"

fn="set-cache-control"

control="private,max-age=3600"

elving at 2007-7-7 3:34:35 > top of Java-index,Web & Directory Servers,Web Servers...