Phoenix v1.3.0-rc.3 Phoenix.Digester View Source

Digests and compresses static files.

For each file under the given input path, Phoenix will generate a digest and also compress in .gz format. The filename and its digest will be used to generate the cache manifest file. It also avoids duplication, checking for already digested files.

For stylesheet files found under the given path, Phoenix will replace asset references with the digested paths, as long as the asset exists in the generated cache manifest.

Link to this section Summary

Functions

Delete compiled/compressed asset files that are no longer in use based on specified criteria

Digests and compresses the static files and saves them in the given output path

Link to this section Functions

Link to this function clean(output_path, age, keep, now \\ now()) View Source
clean(String.t, integer, integer, integer) ::
  :ok |
  {:error, :invalid_path}

Delete compiled/compressed asset files that are no longer in use based on specified criteria.

  • output_path - The path where the compiled/compressed files will be saved
  • age - The max age of assets to keep in seconds
  • keep - The number of old versions to keep
Link to this function compile(input_path, output_path) View Source
compile(String.t, String.t) :: :ok | {:error, :invalid_path}

Digests and compresses the static files and saves them in the given output path.

  • input_path - The path where the assets are located
  • output_path - The path where the compiled/compressed files will be saved