arrow-down
  1. Intro
  2. Usage
  3. API

Static library

Contents

Introduction

Achieve ultra-high performance with detailed control over edge and client caching for your static assets. Serve files bundled in your Enonic app (i.e. js, css + html) with fine-grained control over cache headers and error handling, suitable even for hosting static webapps and SPAs.

For a more simplistic approach to asset hosting, check out lib-asset instead.

Usage

There are many ways of setting up and using lib-static, the gist is:

  1. Add a dependency to lib-static

  2. Place your files in the /src/main/resources/static/ folder

  3. Use a service, mapping or webapp to deliver the assets.

  4. Use relative links, or create links to assets from your controllers

We have created hands-on usage examples to give you a flying start.

For more details, visit the API documentation


Contents

Contents

AI-powered search

Juke AI