• Resolved haddlyapis

    (@haddlyapis)


    Hi there,

    great plugin!

    I would like to understand the logic of FVM please.
    When I choose to register and enqueue a certain JS file to load on only some pages, let’s say e.g.. 5 pages. Does it make sense to ignore this JS file in the plugin? Does it get minified in a different way? to the way the rest of the site gets loaded with minified JS & CSS?
    thx in advance.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Raul P.

    (@alignak)

    How it works now on version 3, is that it reads your HTML source just before being delivered to the browser, extracts all styles and scripts and optimizes them according to the settings.

    It’s no longer relevant enqueuing the files or not, though it’s best practice to use the wordpress hooks and filters.

    If you load a file conditionally, it will only show up on the pages you want, so FVM is like a browser, it will only see it on those pages.

    For every different set of css and js files, the name will change if you are combining css and js, so a dynamic file name will grow your cache indefinitely and you need to exclude it. For your case, unless the file name changes on every pageview, you don’t need to do anything.

    You just decide the settings, if merging, deferring, async, etc.

    Minification is the same for every file.
    What changes is file names, based on how many files you are combining.

    Thread Starter haddlyapis

    (@haddlyapis)

    Great! Thanks for your explanation @alignak. This topic is now closed.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How does fvm handle js/css files only loaded on certain pages’ is closed to new replies.