Drupal is a registered trademark of Dries Buytaert
drupal 11.3.7 Update released for Drupal core (11.3.7)! drupal 11.2.11 Update released for Drupal core (11.2.11)! drupal 10.6.7 Update released for Drupal core (10.6.7)! drupal 10.5.9 Update released for Drupal core (10.5.9)! cms 2.1.1 Update released for Drupal core (2.1.1)! drupal 11.3.6 Update released for Drupal core (11.3.6)! drupal 10.6.6 Update released for Drupal core (10.6.6)! cms 2.1.0 Update released for Drupal core (2.1.0)! bootstrap 8.x-3.40 Minor update available for theme bootstrap (8.x-3.40). menu_link_attributes 8.x-1.7 Minor update available for module menu_link_attributes (8.x-1.7). eca 3.1.1 Minor update available for module eca (3.1.1). layout_paragraphs 2.1.3 Minor update available for module layout_paragraphs (2.1.3). ai 1.3.3 Minor update available for module ai (1.3.3). ai 1.2.14 Minor update available for module ai (1.2.14). node_revision_delete 2.0.3 Minor update available for module node_revision_delete (2.0.3). moderated_content_bulk_publish 2.0.52 Minor update available for module moderated_content_bulk_publish (2.0.52). klaro 3.0.10 Minor update available for module klaro (3.0.10). klaro 3.0.9 Minor update available for module klaro (3.0.9). layout_paragraphs 2.1.2 Minor update available for module layout_paragraphs (2.1.2). geofield_map 11.1.8 Minor update available for module geofield_map (11.1.8).

file_version

5 sites Security covered
View on drupal.org

This module add simple token in files URLs based on file modified time. This is very useful for caching files in CDNs and differentiate if the image changes like a new resource.

Modules that crop images need this for integrate with CDNs. Because the image file name is the same but the image could be different.

You can configure:

  • Add token for image styles URLs
  • Add token for all files URLs
  • Define whitelist and blacklist of file extensions

HOW TO USE:
Go to /admin/config/media/file_version and check if you want use File Version All Files" or only "Image Styles".

  • If you choose "All Files": All files that internal use file_create_url() have file version token.
  • If you choose "Image Styles": All image styles follow system pattern have file version token (included external file system integration like s3fs module).

ADVANCED USE:
You can define a comma separated list to exclude or force files with a extension.

  • Blacklist: a extensions list to exclude, you must have checked File Version All Files" or for "Image Styles".
  • Whitelist: a extensions list to force include, is only thought for use with Styles" checked and add for example pdf extension to include these or for use with none checkbox checked to choose exactly your extensions.

Example file URL without File Version:
http://example.com/sites/default/files/2017-05/example.png

Example file URL with File Version:
http://example.com/sites/default/files/2017-05/example.png?fv=v-malxjm

IMPORTANT:

  • The module will generate absolute URLs for avoid encoding conflicts with GET query parameters.
  • The module use hook_file_url_alter(), so it works with core file/image workflow and all the files using file_create_url().

Activity

Total releases
2
First release
Feb 2025
Latest release
1 year ago
Release cadence
8 days
Stability
100% stable

Releases

Version Type Release date
2.0.2 Stable Mar 5, 2025
2.0.1 Stable Feb 25, 2025