That's exactly what I was thinking about. For example, last weekend I was looking at the products offered by an online bike shop. There were at most a few thousand pages showing product lists with prices. Some of these pages took more than a second (!) to load. What the hell is going on? What's the server doing all that time? That should be instantaneous. It can be solved by a small folder of static html pages, re-generated when stock changes a few times per week.
I'm not a web developer so maybe what I say does not make sense and sounds stupid. But I'm just astonished by what process this happens to be a complicated problem.
to quote you " ... re-generated when stock changes..." - that's exactly the correct wording, except it doesn't happen a few times per week, but a few times per millisecond if you're Amazon. Or a few times per minute if you're a national supplier, any country you want, and you have a sale on Black Friday. That, of course, assumes you want to have almost real-time inventory stock to show to your possible clients. Otherwise, if you don't care to show out of stock items, sure, it can be a few times per week.
But they don't even solve that problem! In both shops that I use (rosebikes.fr and decathlon.fr) stocks are explicitly marked as approximate, with a very visible warning in red when the stock is 2 or 1 items, asking you to call the shop to verify stock. Website is slow as molasses still.
In those particular cases then yeah, it might be a sloppy job, but you didn't made it sound like that initially, instead let us believe you meant it generally speaking
I'm not a web developer so maybe what I say does not make sense and sounds stupid. But I'm just astonished by what process this happens to be a complicated problem.