• Resolved zaphiref

    (@zaphiref)


    I am running a WordPress website which I know is a dynamic website, it is a recipes website created using Elementor on the Hello theme. Under the Cache Dynamic Loaded CSS option it reads:
    Please do not enable this option unless you have non-static (dynamic) loaded CSS

    How do I know whether I have a non-static (dynamic) loaded CSS?

Viewing 1 replies (of 1 total)
  • Plugin Author Gabe Livan

    (@gabelivan)

    @zaphiref Static files are the ones that end with .css and .js and they exist in their location. Most of the assets loaded are static and they are loaded from plugins and the theme. If there’s a reference to a file from /wp-content/plugins/hello/style.css and when you browse the directories of your website (e.g. via a file manager from your hosting company or SFTP) and “style.css” is located in “/wp-content/plugins/hello/”, then you know you’re dealing with a static file.

    By non-static, the plugin refers to anything that is like /?action=load-css or /style.php?load-css=1. The reference is to a PHP file that is loading CSS content based on certain conditions. It’s often a bad practice as I’ve noticed that developers load the whole WP environment just to print a few KB of CSS because they were too lazy or just didn’t know how to generate static files that are read faster and also fewer resources are used as a result.

    Even if the page is cached using a plugin such as WP Rocket, the caching is not applied to the CSS content loaded from /?action=load-css via the LINK (rel=”stylesheet”) tag. So, the WP environment is loaded twice in this case which is not ideal. Some developers optimized the way the CSS is retrieved but still, I’ll prefer to go static all the way. Generate the static files based on conditions, store them in a caching directory, then reference them or just print them as inline CSS code via STYLE tag if the content is not too large.

Viewing 1 replies (of 1 total)

The topic ‘Cache Dynamic Loaded CSS enable or no?’ is closed to new replies.