I’m writing code in PHP to find out the total size of a given webpage. But if the URL points to a single file resource (like a png, gif, txt, etc. file) , then I won’t need to parse the page that the URL passed in points to in order to see if there are any links to other resources (like .js, .css, etc files).
Share
Parhaps parse the response and check MIME type. For example, if you are using cURL: