Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Search API HTML Element Filter 1.0.7 Minor update available for module search_api_html_element_filter (1.0.7). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). Varbase Media Header 9.2.1 Minor update available for module varbase_media_header (9.2.1). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

This module integrates with the Purge framework to clear external caches for files. It automatically queues files and their associated image styles for invalidation whenever a fieldable entity is updated. The module offers flexible options for configuring how these files are invalidated, including using absolute URLs, relative paths, or pattern matching.

The Purge Queuer File URLs module integrates with the Purge framework to
provide external cache invalidation of files. This module ensures that any time
a fieldable entity is updated, files referenced from fields on that entity are
queued for invalidation. Additionally, the image styles of any discovered files
are also queued for invalidation.

Features

  • Invalidation Queuing: Provides a Queuer for file invalidations, allowing flexible integration with any Queue or Processor plugin(s).
  • Image Style and Derivative Support: Generates invalidations for image styles as well as image derivatives.
  • Highly Configurable: Choose between different invalidation methods for files, image styles, and image derivative, filter based on the file scheme (public, private, etc.), and manually configure base URLs.
  • Multiple Ways to Invalidate: Choose between absolute URLs, relative URLs (file paths), or regex/wildcard patterns. For more specific cases, invalidation generation is exposed as a plugin system for easy customization.

Setup

  • Navigate to admin/config/development/performance/purge and enable the Files Queuer and Image Styles Queuer (if desired).
  • Select the configure drop-down on your Files Queuer instance to access the configuration options.

Invalidations

Out of the box, a file's relative URL is used as the invalidation expression. A corresponding Purger must be configured to handle invalidations of the
appropriate type (e.g., relativeurl, absoluteurl, etc.). This module provides
several suitable invalidation types beyond those included with the base
Purge module, to support use-cases relevant to file invalidation.

Extending

Invalidation expression generation can be modified or
extended by interacting with the ExpressionStrategy plugin system included with
this module. This system allows for fine-grained control over how the URL expressions used for invalidation are generated.

ExpressionStrategy Plugin System

The ExpressionStrategy plugin system is the core mechanism for customizing
invalidation expressions. You can create additional plugins if you need to
generate custom expressions for specific use cases, or you can use the standard
Drupal hook system to alter the plugins already available.

Overriding Existing Invalidation Expression Strategies

Implement the hook expression_strategy_info_alter in a custom module to override an existing plugin definition with your own.

Writing a Custom ExpressionStrategy Plugin

If you need to generate custom invalidation expressions, you can create a new
plugin class that implements one of the expression strategy interfaces provided
by this module. You will need to create a custom module to hold your plugins.
Here's a basic example of how to create a custom plugin:

  1. Create a Plugin Class: Extend the ExpressionStrategyBase class in
    order for your class to be correctly discovered as an ExpressionStrategy
    plugin. Then, implement one or more of the expression strategy interfaces
    (e.g., FileExpressionStrategyInterface,
    DerivativeExpressionStrategyInterface, StyleExpressionStrategyInterface)
    to define the types of expressions your plugin can generate.
  2. Define the Expression Generation Logic: In your plugin class, implement
    the necessary methods and define the logic for generating invalidation
    expressions. This logic can be as simple or as complex as needed to meet
    your caching requirements.
  3. Enable the Plugin: Ensure your custom module is enabled, then go to the
    Purge configuration page and select your custom plugin from the list of
    available expression strategies.

Overriding Services

Aside from the ExpressionStrategy plugin system, most of the remaining core functionality of this module is exposed through clear interfaces and registered as services. Any of these components can be extended and overridden in a custom module as needed.

Activity

Total releases
6
First release
Mar 2025
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 6
Maintenance
Dormant

Release Timeline

Releases

Version Type Release date
1.1.0-alpha3 Pre-release May 25, 2025
1.1.0-alpha2 Pre-release May 23, 2025
1.1.0-alpha1 Pre-release Apr 18, 2025
1.0.0-alpha2 Pre-release Mar 27, 2025
1.0.0-alpha1 Pre-release Mar 26, 2025
1.0.x-dev Dev Mar 5, 2025