Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Usage Milestone: Simplify Module simplify crossed 10,000 active installs. Usage Milestone: Views Reference Filter Module entityreference_filter crossed 10,000 active installs. Usage Milestone: Dropdown Language Module dropdown_language crossed 10,000 active installs. Usage Milestone: Paragraphs Browser Module paragraphs_browser crossed 10,000 active installs. Usage Milestone: OpenAPI Module openapi crossed 10,000 active installs. Usage Milestone: Decoupled Router Module decoupled_router crossed 10,000 active installs. Usage Milestone: Time Field for Drupal 8+ Module time_field crossed 10,000 active installs. Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

File Version

8 sites Security covered Drupal 9–10 · not 11
View on drupal.org

This module adds a token to file URLs that changes when a file is modified. This improves caching by allowing CDNs and other systems to differentiate between old and new versions of the same file, especially useful for image styles. You can configure it to apply to all files or only image styles, and optionally whitelist or blacklist specific file extensions.

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().

Depends on

Dependencies of the latest stable release

  • image Drupal core

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
2
Tracked since
Feb 2025
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 2
Maintenance
Dormant

Releases

Version Type Core Release date
2.0.2 Stable 9–10 Mar 5, 2025
2.0.1 Stable 9–10 Feb 25, 2025