Angel 2's version of package:angel_static
includes range header support out-of-the-box, rather than requiring a separate
package.
Support for handling the Range
headers using the Angel framework.
Aiming for 100% compliance with the Range
specification.
In your pubspec.yaml
:
dependencies:
angel_framework: ^1.0.0
angel_range: ^1.0.0
The acceptRanges()
function returns an Angel request handler. This is best used as a
response finalizer.
If you are using response compression in your application, make sure to add it after Range
support.
Save yourself a headache!
configureServer(Angel app) async {
// Apply `Range` headers, if need be
app.responseFinalizers.add(acceptRanges());
// Support gzip, deflate compression
app.responseFinalizers.addAll([gzip(), deflate()]);
}