Cache

Cache outgoing data from underlying Services during its lifetime.

What it does

This Service only works when presented with a context containing an Interaction with an outgoing body of information.

When hit for the first time, it will hand over control to an underlying Service, and cache whatever the underlying hierarchy of Services has written.

When hit after that, it'll return the cached data instead of re-invoking underlying services. It clears after a set lifetime has elapsed.

This makes this Cache suitable for caching precisely one thing, which limits the use cases. However, it's quite useful for i.e. caching CSS on a production environment.

How it works

{
    // Unpack release 7a next to me :)
    plugins = [
        // Cache
        f"Data.dll",            
        // HttpService
        f"BasicHttpServer.dll",  
        // Template
        f"OutputComposing.dll"
    ];

    instances = {
        example = Cache() {
            begin->Template(f"index.html");
        };

        server = HttpService(
            prefixes = ["http://*:8081/"]) {
            http->instances.example;
        };
    };
}

Settings

None.

Branches

begin Outgoing data produced by Services under this branch will be cached