com.alecdorrington.assetloader
Members list
Packages
Type members
Classlikes
A utility for loading and caching static assets so that they can be served by a web server.
A utility for loading and caching static assets so that they can be served by a web server.
Only intended for use when the total number of assets is small enough to fit comfortably in memory.
Warning: Work with the assumption that all files in assetPath will be made publicly accessible.
Value parameters
- assetPath
-
The root directory on the server's file system where assets are stored, relative to the directory of the running server process.
- maxAge
-
The maximum age (in seconds) for which an asset should be considered fresh for caching purposes. Caching is disabled by default (
0).
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
Attributes
- See also
- Companion
- class
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
AssetLoader.type
Types
A static asset that can be served by a web server.
A static asset that can be served by a web server.
Value parameters
- cacheControl
-
The caching rules for the asset. Appears in the
Cache-Controlheader. Tells the browser when a cached asset needs to be replaced. - content
-
The raw bytes from the asset file.
- contentType
-
The MIME type of the asset. Appears in the
Content-Typeheader. Helps the browser understand how to handle the file. - eTag
-
The version hash of the asset. Appears in the ETag header. Helps the browser determine when a cached asset is up-to-date.