JavaScript
fromPagegym
8 hours agoMinifying JavaScript: how much are we saving?
Minification significantly reduces JavaScript transfer size, improving page speed, especially by removing comments and optimizing code.
I ran into a situation where some CSS files from Elementor were breaking when optimization/minification was applied globally. Instead of disabling optimization completely, I used a small snippet to exclude only specific CSS files while allowing others to remain optimized. I added this using the Code Snippets plugin and ran it everywhere. Here is the code: add_action('wp_enqueue_scripts', 'bhavin_remove_unused_elementor_css', 100); function bhavin_remove_unused_elementor_css() { // Check if Elementor is active if (!did_action('elementor/loaded')) { return; }
Speed is critical to the way users interact with websites. Google research shows that bounce rate increases dramatically the longer a site takes to load on mobile. Those that have a 3-second delay risk an increase of 32%, while those that take up to 10 seconds can expect to see it increase by 123%. When we were hired by investment firm Aston Darby to help with their digital marketing, the slowness of their site was one of the first issues we identified. When we first started with them, the site took around seven seconds to load. By the time we'd implemented our optimisations, that figure dropped to just three seconds.