IE Client Performance Question

L

Lars Netzel

Hi,

I have an aspx page with about 2000 rows of javascript code before the Body
TAG. This is starting to get so much that it's affecting the Loading time on
the client for the page and I'm thinking about hwo to make this go faster.

Besides cutting in the Javascript code and removing "//" Remarks and using
very Short Variable names and stuff I don't really know what to do.

What if I would to put the Javascript oin a separate JS file, would that
affect the loading in anyway? I guess the page has to request that JS file
then but does it have to request the whole page only the function in the
actually Runtime when calling the function?

Is it also possible to force the JS file to be Cached on the Client? or
would it be by default since the JS file will very seldom change.

Please help

best regards
/Lars
 
L

Lars Netzel

ok, thanx

But then the performance depends very much on how the Cache settings are set
up on the client I guess, which is fine but I just want to make sure. Or is
this possible to force somehow?

I know in traditional Asp there are some Cache directives you can set in the
begining on the page in <% % > blocks... can this be done for JS files and
make the client NOT checking so often for this?

/Lars
 
E

Eliyahu Goldin

Lars,

It is a good idea to take javascript out into a separate file even if it
contains 20 lines of code. The same applies to the stylesheets. For the
simple reason that these external files don't change often and they will be
cached on client. It will happen by default.

Eliyahu
 
B

Bruce Barker

if you store your script files as "*.js" then they will cache correctly.
note: if you include you script as a seperate file, you can not call
(reliably) the defined functions until onload event fires. this is becuase
the script files and images is loaded by a seperate thread. the onload fires
after the page is parsed, and linked content (such as script files) has been
loaded.

-- bruce (sqlwork.com)
 

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

Top