Achieve — High Level Logic Project. Creating a new meta design pattern.

Friendly in development. Fast in production. Just build your apps. Let Achieve do the rest.

← Back to documentation index

Static content and audio/video

Achieve serves static content and provides byte-range streaming for audio and video.

Achieve automatically sets a Content-Type header for file types with registered extensions. The header tells the browser what kind of resource it has received so that it can handle and render it properly. Files with unregistered extensions are served as text/plain.

The registered extensions for ordinary static and audio/video files can be displayed at startup with showMimeTypes():

achieve.showMimeTypes();

If you want to serve another MIME type, add it with addMimeType():

achieve.addMimeType("pub", "application/x-mspublisher");

To add an audio/video type with byte-range support, use addAVMimeType():

achieve.addAVMimeType("wav", "audio/wav");

When a directory is requested, Achieve uses the first available default in this order: index.html, index.htm, index.jss, index.jss.mjs, and index.jss.cjs. The .jss forms are executable servlets rather than static source.

See the Static Resources Reference for the complete default-document order, caching, compression, byte ranges, and response-header behavior.