Every file on the web, be it a web page, a text file or whatever has HTTP headers associated with it. This is meta information about the file that is sent before the actual contents of the file itself. Included in this meta information is the size of the document.
This technique uses JavaScript to read that data, return the file size, and dynamically add it.
Related Submissions:
- Easy CSS Compression with PHP and mod_rewrite One of the most important aspects of having a website is speed. I looked into some CSS compression ideas, but I wanted one script that...
- How To Use Custom ini Files With PHP Learn the basics of setting up a ini config file for your web application, including how to pull and parse information from the file. ...
- Minify - Combine & Compress CSS or Javascript Files Minify is a PHP5 app that can combine multiple CSS or Javascript files, compress their contents (i.e. removal of unnecessary whitespace/comments), and serve the results...
- Flexigrid for jQuery Flexigrid is a lightweight but rich javascript data grid with resizable columns and a scrolling data to match the headers, plus an ability to connect...
- Build a PHP Twitter Widget Today I will be showing you how to use cURL to get your Twitter status and cache it into a file on your server. This...