Push manifest with URI templates
Currently server push based on globs is implemented. The configuration spec allows URI Templates too.
-
Trigger push if the request/response pathname matches the URI template.
manifest: [ {uri: '{?foo,bar}', push: {glob: '**/*.css'}} // match: /index.html?foo&bar // -> push all CSS files ]
-
Push assets that match the URI template.
manifest: [ {uri: '/articles/{category}', push: {uri: '/images/header-{category}.jpg'}} // match: /articles/food // -> push the header image for the specific category ]
References
- https://github.com/geraintluff/uri-templates (can do reverse matching, used this before in LGTM's client-side router)
- https://github.com/grncdr/uri-template
- https://github.com/fxa/uritemplate-js
Edited by Sebastiaan Deckers