Support » Plugin: Fast Velocity Minify » Hook when a css or js file is generated

  • Resolved hz_i3

    (@hz_i3)


    Is there a hook that I can use after a css or js file is generated?

    My use case is that, I use a CDB and I want to visit the css/js CDN URL to warm the cache.

    Thanks

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

    (@alignak)

    Hi,

    Not at the moment, but if you are a programmer… I would suggest that you scan the cache directory for a list of files, get the full url and pipe them all over curl to the cdn.

    I’ll see if I can add a hook in the future.

    However, please note that when using a cdn and doing preload, you are actually only preloading them on the nearest edge to your server.

    So for example, if your server is in London, preloading the cdn would actually only preload it in London, but not in France, Germany or the US.
    Unless of course, they provide some api or you use multiple proxy services… but that is not very common.

    Rather than preloading the css/js files, I suggest preloading the page itself.

    Also note that the compression level on the cdn is often lower than your own server.
    If you have a fast server and a large css file, your server may actually be serving a more compressed css file than your cdn, which improves your scores.

    The cdn will load it faster, especially for a global or multi regional audience, but for very local markets, sometimes serving the files directly are more efficient.

    I wish CDN services started precompressing content, rather than doing it on the fly.

    Thread Starter hz_i3

    (@hz_i3)

    Thanks for the detailed reply, Paul.

    I use this plugin with Super Cache which I use the preload feature.

    I see the downside of using CDN, that I never thought of.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Hook when a css or js file is generated’ is closed to new replies.