I don't know what to tell you if you're convinced that's the problem. I know and work with many web developers who do care about performance. I follow the blogs of many web developers who write about performance.
I don't doubt that there are junior web developers who don't know much better. But I don't really meet anyone who says that they just don't care about performance.
Caring about performance means weighing the decision carefully when choosing vendor libraries that fill up your payload. You can consciously care about performance but still be negligent to the things that affect it.
I see competent devs reach for libraries all the time when a simple solution already exists within the language. It's easy to feel like you're doing the right thing by not reinventing the wheel.
Areas I see this happening a lot in are anything dealing with file systems, HTTP request/responses, database connections, DOM/string manipulation/parsing/validation. The common theme among all these things is usually a lack of understanding of what the library/package does well enough to implement the specific use case needed.
> I don't doubt that there are junior web developers who don't know much better.
I just think it's very... puritanical the way that people bemoan the state of websites as a personal failing of web developers as a profession rather than the a result of what kind of deliverables their employers care about and are willing to pay for.
Whenever I see the term "web developers" in this context, I'm assuming it means all of the decisions they make given the requirements and inputs from others in the business.
I think the web is currently terrible and I think modern web-development is to blame, but that includes the people behind the web-devs making the decisions that are being pushed onto the web-devs.
There are a lot of things to blame for the current state of the web, but ultimately the current practice of web-development (and whatever behind-the-scenes processes that involves) is clearly the biggest reason why.
See in my mind that’s like blaming construction workers for condos built quickly with shoddy materials. I don’t choose the materials I work with most of the time. I have worked on maybe one greenfield application in my entire life. It was really small and performed well. Everything else has been making the best out of bad decisions made by other people.
I agree that it isn't fair, but that's also just how it goes. I get blamed all the time for poor decisions made by my group, even if I agree that they are poor decisions.
I don't doubt that there are junior web developers who don't know much better. But I don't really meet anyone who says that they just don't care about performance.