mirror of
https://github.com/django/django.git
synced 2025-08-04 19:08:28 +00:00
Fixed #17896 -- Added file_hash method to CachedStaticFilesStorage to be able to customize the way the hashed name of a file is created. Thanks to mkai for the initial patch.
This commit is contained in:
parent
085c03e08b
commit
5f75ac91df
4 changed files with 71 additions and 8 deletions
|
@ -348,6 +348,15 @@ CachedStaticFilesStorage
|
|||
:setting:`CACHES` setting named ``'staticfiles'``. It falls back to using
|
||||
the ``'default'`` cache backend.
|
||||
|
||||
.. method:: file_hash(name, content=None)
|
||||
|
||||
.. versionadded:: 1.5
|
||||
|
||||
The method that is used when creating the hashed name of a file.
|
||||
Needs to return a hash for the given file name and content.
|
||||
By default it calculates a MD5 hash from the content's chunks as
|
||||
mentioned above.
|
||||
|
||||
.. _`far future Expires headers`: http://developer.yahoo.com/performance/rules.html#expires
|
||||
.. _`@import`: http://www.w3.org/TR/CSS2/cascade.html#at-import
|
||||
.. _`url()`: http://www.w3.org/TR/CSS2/syndata.html#uri
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue