Module | Sprockets::Digest |
In: |
lib/sprockets/digest.rb
|
`Digest` is an internal mixin whose public methods are exposed on the `Environment` and `Index` classes.
Returns a `Digest` instance for the `Environment`.
This value serves two purposes. If two `Environment`s have the same digest value they can be treated as equal. This is more useful for comparing environment states between processes rather than in the same. Two equal `Environment`s can share the same cached assets.
The value also provides a seed digest for all `Asset` digests. Any change in the environment digest will affect all of its assets.
The `Environment#version` is a custom value used for manually expiring all asset caches.
Sprockets is able to track most file and directory changes and will take care of expiring the cache for you. However, its impossible to know when any custom helpers change that you mix into the `Context`.
It would be wise to increment this value anytime you make a configuration change to the `Environment` object.