Testing for Unused Assets?

Does anyone know of a site/tool anywhere that can test a site to establish whether all of the assets a page downloads, actually gets used or not? I’m working on something I didn’t put together, and can’t help thinking half the page weight is down to assets that aren’t even being used. Is there anything like that out there?

Do you use Chrome? There’s a thing in Dev Tools called “Audits” - run an audit on a page, and you can see tons of detail on that stuff. Not sure if Firefox has something similar, probably.

I do use Chrome as it happens. I need to go digging I think and see where that’s hidden.

Yeah, it’s nifty. F12-> Audits tab and then you can just drill down into items and take a look. It’ll tell you, for example, the % of items in a css file that are unused, and then below that, a list of the rules. Also other good info in there.

1 Like

I’ve just had a poke around in there - what a cool tool that is. It looks like one of those things that I’d not really understood the purpose of, one of many no doubt. Looks like it’s time to learn a few things

87% unused :cold_sweat:

I’m used to working in just one of the CSS file on b2evo, but I’m well aware that there are others, another 10 to be precise. I guess that’s what you get with someone else’s CMS. It’s set up to cover all eventualities, but that isn’t what I need - my usage of it is quite simple. The consequence is, that I’m downloading masses of stuff, that’s just not required. I’ve been looking at ‘inspect element’ a lot just recently, and it’s amazing how many times rules are getting overridden.

I read an article and watched a video by Harry Roberts on the approach he takes with ITCSS - I must confess, I like the look of that a lot. I’d been giving its use some thought, but I was looking at things on a rather wider basis - tidying up the one file I work on, as much as it makes things a little clearer for me, may well have minimal impact from a page load perspective. That’s why I’m trying to understand exactly what’s being used - ideally, anything that doesn’t have a purpose can go.

I’m looking at it as a bit of a learning opportunity.

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.