tracking bandwidth

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I have a chat script which I added very basic bandwidth tracking to as follows:

print "this is some output!";
print "this is more output!";
$bytes = ob_get_length(); // Amount of bandwidth used

The problem is that this merely gives me how many bytes of text were printed...
The script uses JS functions in external files to generate everything for the
page, which means the .js files are cached after the first time and only a
<script> tag and a list of function calls are sent per refresh.

I would like a way to know if the client has cached these scripts, or if they
are being sent for the first time, etc, so I can add the file size of the .js
files to the bandwidth total..

e.g. if ($client_has_not_cached_js_files){ $bandwidth += $size_of_js_file; }

The chat script also allows for user icons, so again I would like to be able to
tell if each image was cached or whether a new copy of the image was sent to the

Is there any way I can get this info with Javascript and then use AJAX to post
it back to the server ?


----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==---- The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----

Re: tracking bandwidth

Skeleton Man,

Quoted text here. Click to load it

This is possible but why would you even want to run everything through a  
PHP script first?  There is no way of telling that the person got the  
document unless PHP autoparses everything.

However, you might want to keep a log from apache on the information and  
calculate it off of there log file, that will give you much more detail  
to work with.


Site Timeline