Title: wowlayers's Replies | WordPress.org

---

# wowlayers

  [  ](https://wordpress.org/support/users/wowlayers/)

 *   [Profile](https://wordpress.org/support/users/wowlayers/)
 *   [Topics Started](https://wordpress.org/support/users/wowlayers/topics/)
 *   [Replies Created](https://wordpress.org/support/users/wowlayers/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/wowlayers/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/wowlayers/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/wowlayers/engagements/)
 *   [Favorites](https://wordpress.org/support/users/wowlayers/favorites/)

 Search replies:

## Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP Super Cache] Filter to intercept cached static HTML files, right before they are serverd.](https://wordpress.org/support/topic/filter-to-intercept-cached-static-html-files-right-before-they-are-serverd/)
 *  Thread Starter [wowlayers](https://wordpress.org/support/users/wowlayers/)
 * (@wowlayers)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/filter-to-intercept-cached-static-html-files-right-before-they-are-serverd/#post-18041616)
 * [@dilirity](https://wordpress.org/support/users/dilirity/) thanks for taking 
   the time to write.
 * In the end it seems WP Super Cache, creates separate folders for each domain,
   so my issue is resolved 🙂
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP Super Cache] Filter to intercept cached static HTML files, right before they are serverd.](https://wordpress.org/support/topic/filter-to-intercept-cached-static-html-files-right-before-they-are-serverd/)
 *  Thread Starter [wowlayers](https://wordpress.org/support/users/wowlayers/)
 * (@wowlayers)
 * [1 year, 12 months ago](https://wordpress.org/support/topic/filter-to-intercept-cached-static-html-files-right-before-they-are-serverd/#post-18028612)
 * I tried this filter, I am almost sure this is the one, but it doesn’t log anything.
 *     ```wp-block-code
       add_filter('wp_cache_served_cache_file', 'modify_served_cache_file', 10, 1);function modify_served_cache_file($cache_file) {    // Inspect the cache file being served    error_log("Serving cache file: " . $cache_file);    // Modify the cache file path or manipulate its content if needed    // Example: Read and replace content dynamically    if (file_exists($cache_file)) {        $cache_data = file_get_contents($cache_file);        // Example: Replace the domain dynamically based on the request        $current_domain = $_SERVER['HTTP_HOST'];        $cached_domain = 'primary-domain.com'; // Replace with your cache domain        // Replace domain in cached data        $cache_data = str_replace($cached_domain, $current_domain, $cache_data);        // Save the modified content back to the file (optional)        file_put_contents($cache_file, $cache_data);    }    // Return the modified or original cache file path    return $cache_file;}
       ```
   
 * This is my WP_DEBUG Setup
 *     ```wp-block-code
       define( 'WP_DEBUG', true );define( 'WP_DEBUG_LOG', true );define( 'WP_DEBUG_DISPLAY', false ); // Prevents errors from displaying on the frontend@ini_set( 'log_errors', 1 );@ini_set( 'display_errors', 0 ); // Prevents errors from displaying on the frontend
       ```
   
 * WP Super Cache is set to operate in Simple Mode.
 * Any ideas would help 🙂

Viewing 2 replies - 1 through 2 (of 2 total)