5 reasons we don’t need to combine CSS/JS files with HTTP/2

dailydose

#1

In WordPress, we can see minify/combining option comes with many caching plugins, as well as there are separate special plugins for it. Many testing tools say that “Reduce HTTP Request”, that encourage us to shift toward a plugin which combines CSS and JS in the few file. However, there is disadvantage of doing so. The industry is talking about, unfortunately, many people are still not aware. So, I thought to share the top 5 facts which you need to know.

  • It’s age of HTTP/2, forget about old-school HTTP 1.1 approach where combining CSS and JS used to be helpful. If you are using HTTP version site, then combining CSS makes sense but if you are on HTTPS chances via host or CDN you might be already using HTTP/2 which has capability to load multiple Files at once.

  • Every time we purge, for Minify Plugin, it increases CDN Edge Cache ‘MISS’ response. What does it mean? You force CDN to fetch another version of the new file. That cost loss of Browser cache and Bandwidth.

  • Every time we purge, it encourages chances of another 404 for Search Engine crawlers.

  • Minify and Combine approach with HTTP/2 may improve any testing score, not significant load time.

  • Special plugin which offers such feature may increase usage of CPU Load, Disk size. It’s better to think forward.

Learn in detail


Check if a website supports HTTP/2
https://tools.keycdn.com/http2-test

DailyDose

Thanks & Regards,
Gulshan


Concatenation of CSS and JS while using http2
[Guide] How to Setup WP Rocket Cache Plugin?
[Guide] How to Setup W3 Total Cache Plugin?
Speed Up WordPress (Top 5 High Priority Tips)
How to Fix these Errors?
#3

Don’t Minify using plugin because it changes CSS and JS path.

Instead, it’s a good idea to leave it or do minify on-the-fly using a CDN like Cloudflare.


#4

What about the Slow DNS response because possible 10 CSS files have to be requested instead of just 1 single css file, Wouldnt the 10 file request add more load then a single file?


#5

DNS query will be initiated for the first HTTP request, rest there will be cached. Isn’t it?


#7

@anon13276939 On an adsense site i will never recommend to minify JS (if u r using adsense)


#8

Of course, yes. I can’t recommend minifying CSS and JS via any plugin. The way it works is disappointing.


#9

I don’t want to use any CDN, Any way to enable it on DigitalOcean server? @gulshankumar


#10

@Hitesh Minifying or HTTP/2?


#11

HTTP/2. :slight_smile:


#12

#13

Seems complicated, will try this on a demo domain first. :slight_smile: Thanks


#14

Not DNS, but every query generally has a wait time. Especially for sites with multiple adsense ad units. IN such cases, i prefer that CSS be loaded in a single file so that the DNS queries of Adsense receive more time and there is lesser wait time for the same. Hence, i generally combine and minify CSS files.


#16

“Respect Existing Header”


#18

Cloudflare CDN will maintain same time-period for keeping cache in the Browser, as existing cache settings plugin of your WordPress.

By having ‘Respect existing header’, we tell Cloudflare to do not override origin cache-control header response of static files. For example, if someone keep 8 days it is also good starting point, but it override cache plugin settings. You are free to keep as you wish. :slight_smile:


#19

Just a suggestion:

If someone is using Cloudflare as the entry point, it is always suggested to entertain visitors then and there. It will reduce the load on the server. Like, optimize the site using CF features instead of a cache plugin.


#20

@Mustaasam_Saleem Welcome! Glad to see you :slight_smile:


#21

Keep up the excellent work! :slight_smile:


#22

@Mustaasam_Saleem Hey mate, could you please tell us wheyther Cloudways supports memecache by default?


#23

Yes, it supports.


#24

Is it enabled already or we need to do that manually?