r/elementor • • 5d ago

Problem v4 Atomic + WP Fastest Cache: CSS file intermittently 404s, reappears after about 30 min. Has anyone seen something similar?

Hi all,
we're about to launch a site and can't pin down the cause. I'd appreciate any experience you can share.

Setup:
- WordPress with Elementor Pro, v3 and v4 widgets mixed on every page, Atomic experiments active
- CSS print method: External Files
- Cache plugin: WP Fastest Cache, Element Caching in Elementor disabled

Observation:
Between 2 and 8 subpages at a time render without styles. In the browser's network tab, the page's Elementor CSS file (/wp-content/uploads/elementor/css/post-XXX.css) returns a 404, even with the browser cache disabled. Opening the URL directly confirms it. After about 30 minutes the file was back with the same version parameter. We changed nothing in that time. Shortly before, someone had only logged into the WordPress backend; there was no update.

Comparison: On other client sites with Elementor Pro and WP Fastest Cache, but only v3 without Atomic, we had a similar problem. After aligning the cache and Elementor settings, those sites have been stable. The same settings don't work on this site.

What we've tried:
- Regenerating Elementor files and clearing the cache (only helps briefly)
- Disabling browser caching in the plugin (the setting doesn't save)
- Switching CSS print method to Internal Embedding: causes a server error when saving Elementor pages

Questions:
- Has anyone seen Elementor CSS files disappear or go missing temporarily without any action on your side?
- Has anyone run Atomic with WP Fastest Cache stably? If not, which cache plugin do you use?
- Could the server error when saving with Internal Embedding be related to Atomic?

Thanks for any pointers!

2 Upvotes

13 comments sorted by

•

u/AutoModerator 5d ago

Hey /u/genevieve_333!

We noticed you may be looking for a caching recommendation. We suggest checking out FlyingPress for a reliable and high-performance caching plugin.

For more recommendations: Check out our Megathread of Recommendations.

If your post has not already been flaired, please add one now. If you have a problem or question, please make sure to post a link to your issue so users can help you. Make sure to list if you're using Elementor Free (or) Pro and what theme you're using. Don't forget to mark your post as "Answered" once your question has been solved.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

2

u/kizaro-barbosa 5d ago

yes but with litespeed cache. Switching css print methods and saving permalinks and purging all cache. it starts working again

2

u/_miga_ 🏆 #1 Elementor Champion 5d ago

There was an issue on Github and a PR for it to clear the database cache when the files are not there anymore so that this scenario won't happen. Can't find it at the moment but it was in testing already. That should normally prevent this. That said: I'm using WP Super Cache and not had any issues with missing post-xxx.css files

2

u/zeiniez ✔️️‍ Experienced Helper 3d ago

The WP Fastest Cache developer recommends changing Elementor's CSS Print Method to "Internal Embedding" to avoid their plugin from serving stale cache.

You should also consider activating the "Optimized CSS Files" experimental feature for better support. It aims to prevent cache plugins from serving stale cache like u/miga mentioned.

1

u/zeiniez ✔️️‍ Experienced Helper 2d ago

Hi u/genevieve_333 , Nick here from Elementor! 👋

I was reading your post again as I'm sharing this information with the team so they can revisit these issues. So far the experiment I shared seems to work very well with WP Fastest Cache (WPFC), but I have an additional recommendation below.

Although before I share it, I'd like to learn a little more about what you meant by "Switching CSS print method to Internal Embedding: causes a server error when saving Elementor pages", if you don't mind. Would you be so kind to explain this with more detail, maybe even share (privately) your server logs, a screenshot or screen recording of the errors so we can verify and fix it? We would really appreciate it! 🙏

As for what you could try temporarily is to use the following php snippet to trigger WPFC's clear/purge every time Elementor clears its own cache, which should help with the stale cache problem:

/**
 * Elementor -> WP Fastest Cache sync.
 *
 * Purges WP Fastest Cache whenever Elementor deletes its generated CSS files,
 * so cached pages never point at CSS files that were removed or regenerated.
 *
 * Works as a Code Snippets plugin entry, in a child theme's functions.php,
 * or as an mu-plugin (drop this file into wp-content/mu-plugins/).
 *
 * What it does:
 * - Listens to 'elementor/core/files/clear_cache' (kit save, variables, Tools >
 *   Clear Files, plugin/theme changes, etc.).
 * - Listens to 'elementor/global_classes/update' (global class edits), which
 *   deletes CSS files without calling clear_cache. Preview/draft edits are ignored.
 * - Purges once per request, on 'shutdown', after Elementor has finished.
 * - If WPFC "Minify CSS" or "Combine CSS" is enabled, it also purges WPFC's
 *   minified cache. WPFC names minified files from the CSS URL without ?ver=,
 *   so a regenerated Elementor file would otherwise keep its old minified copy.
 * - Preload needs no special handling: WPFC re-arms it itself when it clears,
 *   and its crawler renders pages normally, so Elementor regenerates its CSS first.
 *
 * Known limits:
 * - A request already in flight during a purge can re-cache a stale page once.
 * - To avoid the extra minified purge, add a WPFC Exclude rule (type CSS,
 *   "contain") for /elementor/css/ instead. That is a settings change.
 */


if ( ! defined( 'ABSPATH' ) ) {
    exit;
}


/**
 * Clear WP Fastest Cache (and its minified CSS/JS when CSS optimization is on).
 */
function
 ewpfc_purge() {
    if ( ! function_exists( 'wpfc_clear_all_cache' ) ) {
        return; 
// WP Fastest Cache is not active.
    }


    $options  = json_decode( (
string
) get_option( 'WpFastestCache' ) );
    $minified = is_object( $options )
        && ( ! empty( $options->wpFastestCacheMinifyCss ) || ! empty( $options->wpFastestCacheCombineCss ) );


    wpfc_clear_all_cache( $minified );
}


/**
 * Queue a single purge for the end of the current request.
 */
function
 ewpfc_queue_purge() {
    
static
 $queued = false;


    if ( $queued ) {
        return;
    }
    $queued = true;


    if ( did_action( 'shutdown' ) ) {
        ewpfc_purge();
        return;
    }


    add_action( 'shutdown', 'ewpfc_purge', 99 );
}


// Elementor cleared all of its generated files.
add_action( 'elementor/core/files/clear_cache', 'ewpfc_queue_purge' );


// Global classes changed. Ignore draft/preview-only edits.
add_action( 'elementor/global_classes/update', 'ewpfc_on_global_classes_update' );
function
 ewpfc_on_global_classes_update( $context = 'frontend' ) {
    if ( 'preview' !== $context ) {
        ewpfc_queue_purge();
    }
}

You can add this to your child theme's functions.php file, a code snippets plugin, or create an mu-plugin with this snippet inside.

1

u/Early-Community9943 5d ago

Likely the deleted post-XXX.css only gets rebuilt when Elementor actually renders the page, and WPFC keeps serving cached HTML until it expires (~30 min). Purge the page cache whenever Elementor clears its CSS and it should stop.

1

u/benfaust 5d ago

The file coming back around 30 min later points at elementor's css regeneration cron refilling a folder that something else is clearing. Try disabling WP Fastest Cache for a day, if the 404s stop, it's the plugin purging that uploads dir, not Atomic.

0

u/eunuskhan 5d ago

A post-XXX.css that 404s and later comes back usually means the file was deleted and regenerated. Something (a cache clear, backup job or plugin hook) is clearing Elementor's CSS folder while the page cache keeps serving HTML pointing to the old files. Check what ran around then, and try switching page caching off for a day to see if the 404s stop. Similar reports exist with Atomic too, but that alone doesn't prove it's the cause.

For the Internal Embedding server error, check your Elementor version (reports of a malformed save response on 4.3.x) and the PHP error log from the failed save.

To isolate Atomic, disable the experiment on a staging copy and compare.

0

u/fer_marketing 5d ago

The page cache serving old HTML explains why it fixes itself after a while, but not why the CSS file disappears in the first place. If it comes back 30 minutes later with the same version, something is wiping /uploads/elementor/css (a cache purge, a backup job, a security plugin cleanup) and it gets rebuilt later. Match the 404 times against your cron jobs and the server logs, that tells you who's doing it.

On a site that's about to launch I'd also move caching to the server level instead of a plugin. One less thing fighting with Elementor.

0

u/MarkGossageUK 4d ago

Have you tried temporarily disabling WP Fastest Cache on a staging copy and regenerating Elementor's CSS files? I'd also check whether your host has its own caching or scheduled cleanup running. The fact that the files disappear and then return without you changing anything makes me suspect an automated process.