## What is this?

To be able to use Far Future expiration, we need to make sure that the URL of a file changes whenever the file changes. Otherwise, visitors will continue to use the old version of the file, that they've cached.
Depending on the type of file, it is usually better to use a different unique file identifier (UFI) method. Overall, you will want to minimize the number of times that the file system needs to be accessed.

That's why the `perpetual`, `drupal_version`, `drupal_cache` and `deployment_id` methods are the most efficient: they don't touch the file system at all. However, `perpetual` will never detect file changes, so only use that if you're absolutely certain a file will never change (e.g. for video files). `drupal_version` should only be used for Drupal core files. `drupal_cache` is useful while doing development and for validating your cache stack. And `deployment_id` should probably only be used for files that are managed through version control.

## Format

Enter one rule per line, in the format <directory>[|<extensions>]|<unique file identifier (UFI) method>:

- <directory> is the directory (may include wildcards) to which a unique identifier method will be applied. Multiple directories may be listed, separated with semi-colons (`:`). E.g.:

      sites/*/modules/*:sites/*/themes/*

- <extensions> is an optional setting to limit which file types should use this unique identifier method. E.g.:

      .css .jpg .jpeg .png

- <UFI method> sets the unique identifier method that should be applied to the aforementioned directories, and only to (optionally) the listed file types.

Note: To see which UFI methods are available, please consult the UI — this help system only allows for static content.

## Examples

This would generate a unique identifier for Drupal core files based on the Drupal core version, files in the site directory would get unique identifiers based on the last time they were modified and movie files would not receive a unique identifier (they're so large browser can't cache them anyway):

    misc/*:modules/*:themes/*|drupal_version
    sites/*|mtime
    sites/*|.avi .m4v .mov .mp4 .wmv .flv|perpetual

In this second example, we're dealing with a more high-traffic website, where it is too costly to access the filesystem for every served file. Therefor, this site defines a `CDN_DEPLOYMENT_ID` constant somewhere in its codebase. This constant changes whenever a module or theme changes. This is therefor far more efficient. See the last line:

    misc/*:modules/*:themes/*|drupal_version
    sites/*|mtime
    sites/*|.avi .m4v .mov .mp4 .wmv .flv|perpetual
    sites/*/modules/*:sites/*/themes/*|deployment_id