Phoenix v1.3.0-rc.2 Phoenix.Digester

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.

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

Functions

clean(output_path, age, keep, now \\ now())
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
compile(input_path, output_path)
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