From aa3d3b2d826707d9aba7c8f0db0b3911669f388b Mon Sep 17 00:00:00 2001 From: Tim Burt Date: Tue, 22 May 2018 19:21:50 +0100 Subject: [PATCH] Update docs --- README.md | 43 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f054e90..3943b9a 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,44 @@ -# silverstripe-cdnrewrite +# Silverstripe CDN Rewrite +Provides a simple method of rewriting the URLs of assets and resources to allow the use of a subdomain or external CDN service + +# Requirements +*Silverstripe 4.x + +# Installation +* Install the code with `composer require dorsetdigital/silverstripe-cdnrewrite` +* Run a `dev/build?flush` to update your project + +# Usage + +The module won't make any changes to your site unless you do a bit of configuration. There are a few options to set, done in a yml file: + + +```yaml +--- +Name: cdnconfig +--- + +DorsetDigital\CDNRewrite\CDNMiddleware: + cdn_rewrite: true + cdn_domain: 'https://cdn.example.com' + rewrite_assets: true + rewrite_resources: true + add_debug_headers: true + enable_in_dev: true +``` + +The options are hopefully fairly self explanatory: + +* `cdn_rewrite` - globally enables and disables the module (default false - disabled) +* `cdn_domain` - the full domain name of the CDN (required to enable module) +* `rewrite_assets` - whether to rewrite references to the 'assets' directory (default false) +* `rewrite_resources` - whether to rewrite references to the 'resources' directory (default false) +* `add_debug_headers` - if enabled, adds extra HTML headers to show the various operations being applied (default false) +* `enable_in_dev` - enable the CDN in dev mode (default false) + + +# Credits +* Very much inspired by [Werner Krauss' silverstripe-cdnrewrite](https://github.com/wernerkrauss/silverstripe-cdnrewrite) +* As always, thanks to the core team for all their hard work.