Calculate sent file size

R

Roy Danon

Hi,
How can I find out what is the size of the HTML page i've sent to the
client's browser?
(Without using the server logfiles)

Roy.
 
S

Steven Burn

<%
Dim FSO
Set FSO = CreateObject("Scripting.FileSystemObject")
Set FL = FSO.GetFile(Server.MapPath("this_is_the_file.html"))

Response.Write FL.Size

Set FSO = Nothing
%>

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)
 
R

Ray at

Ah, but what about when it's an ASP page that can vary in output length
based on user input?


I was going to say that you could have the page call itself with an http
request using xmlhttp, but it seems this would cause an endless loop that
your server may not enjoy.

page calls page, which calls page, which calls page, which calls page, which
calls page, which calls page....

Of course you could always have the page only call itself if the remote_addr
is not the IP of the server or something like that.

Ray at work
 
A

Aaron Bertrand [MVP]

Of course you could always have the page only call itself if the
remote_addr
is not the IP of the server or something like that.

Or pass a parameter that says "don't invoke the XMLHTTP call"... that way
you could test either from remote or local.
 
R

Roy Danon

My Mistake,

By saying "the HTML page" I ment the HTML code the ASP application
generates.


Thanks,
Roy.
 
R

Roy Danon

My point here is to measure the level of traffic a groups of pages uses and
limit it at some point,
requesting the page again with couse doubled traffic which is simply a waste
of money and resources.


Roy.
 
R

Roland Hall

: My Mistake,
:
: By saying "the HTML page" I ment the HTML code the ASP application
: generates.

The HTML code or the file size including any images, etc.? Do you really
want to limit or change accordingly? If the log file already performs the
calculations for you, anything else you use "is a waste of money and
resources." Using the log file, it's a simple lookup, run it each night and
if the user goes over their limit, charge them accordingly.

http://webdesign.about.com/cs/loganalysistools/a/aaloganalysis.htm

HTH...


--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
 
R

Roland Hall

:
:"Roy Danon" wrote:
: : My Mistake,
: :
: : By saying "the HTML page" I ment the HTML code the ASP application
: : generates.
:
: The HTML code or the file size including any images, etc.? Do you really
: want to limit or change accordingly? If the log file already performs the
: calculations for you, anything else you use "is a waste of money and
: resources." Using the log file, it's a simple lookup, run it each night
and
: if the user goes over their limit, charge them accordingly.
:
: http://webdesign.about.com/cs/loganalysistools/a/aaloganalysis.htm

change = charge.
 
A

Aaron Bertrand [MVP]

My point here is to measure the level of traffic a groups of pages uses
and
limit it at some point,
requesting the page again with couse doubled traffic which is simply a waste
of money and resources.

How many different variations of the ASP page can be sent back? Couldn't
you measure that up front?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,145
Messages
2,570,826
Members
47,373
Latest member
Desiree036

Latest Threads

Top