README.md in s3_website-2.10.0 vs README.md in s3_website-2.11.0

- old
+ new

@@ -89,12 +89,12 @@ ## Additional features ### Cache Control -You can use either the setting `max_age` or `cache_control`to enable more -effective browser caching of your static assets. +You can use either the setting `max_age` or `cache_control`to enable more +effective browser caching of your static assets. #### max_age There are two possible ways to use the option: you can specify a single age (in seconds) like so: @@ -115,15 +115,15 @@ After changing the `max_age` setting, push with the `--force` option. Force-pushing allows you to update the S3 object metadata of existing files. #### cache_control -The `cache_control` setting allows you to define an arbitrary string that s3_website +The `cache_control` setting allows you to define an arbitrary string that s3_website will put on all the S3 objects of your website. - -Here's an example: +Here's an example: + ```yaml cache_control: public, no-transform, max-age=1200, s-maxage=1200 ``` You can also specify a hash of globs, and all files matching those globs will have @@ -239,11 +239,11 @@ When you run the command `s3_website cfg apply`, it will ask you whether you want to deliver your website via CloudFront. If you answer yes, the command will create a CloudFront distribution for you. -If you do not want to receive this prompt, or if you are running the command in a non-interactive session, you can use `s3_website cfg apply --headless`. +If you do not want to receive this prompt, or if you are running the command in a non-interactive session, you can use `s3_website cfg apply --headless` (and optionally also use `--autocreate-cloudfront-dist` if desired). #### Using your existing CloudFront distribution If you already have a CloudFront distribution that serves data from your website S3 bucket, just add the following line into the file `s3_website.yml`: @@ -321,10 +321,18 @@ index.php: / about.php: /about.html music-files/promo.mp4: http://www.youtube.com/watch?v=dQw4w9WgXcQ ``` +On terminology: the left value is the redirect source and the right value is the redirect +target. For example above, *about.php* is the redirect source and */about.html* the target. + +If the `s3_key_prefix` setting is defined, it will be applied to the redirect +target if and only if the redirect target points to a site-local resource and +does not start with a slash. E.g., `about.php: about.html` will be translated +into `about.php: VALUE-OF-S3_KEY_PREFIX/about.html`. + #### Routing Rules You can configure more complex redirect rules by adding the following configuration into the `s3_website.yml` file: @@ -393,9 +401,20 @@ bucket or CloudFront distribution. It will merely print out what the `push` operation would actually do if run without the dry switch. You can use the dry run mode if you are unsure what kind of effects the `push` operation would cause to your live website. + +### S3 website in a subdirectory of the bucket + +If your S3 website shares the same S3 bucket with other applications, you can +push your website into a "subdirectory" on the bucket. + +Define the subdirectory like so: + +```yaml +s3_key_prefix: your-subdirectory +``` ## Migrating from v1 to v2 Please read the [release note](/changelog.md#200) on version 2. It contains information on backward incompatible changes.