Caching (possibly IIS related?)

R

Rob Meade

Hi all,

I have a web application which gets *very* few hits, especially as its only
just been launched, but even after that it'll be a "quiet" site.

My problem is that when I am the first person to visit it for the day (like
this morning) it takes much longer to load - my understanding (having
attended a MS asp.net course some time ago) was that this is because its
doing the recompile to MSIL (please correct me if I'm wrong). I brought
this up on the course and the instructor chappy did say something about how
to extend its cache so that it didn't do it every day - perhaps once a week
or something - but it was a while ago and do you think I can remember what
he said - nope!

Can anyone give me any suggestions on how to get around this problem - the
content of the site is not dynamic and will only ever change if the client
contacts me to update it - therefore to be honest I would be happy to set
the cache at say 6 months or something longer so that this constant rebuild
problem goes away and thus the site loads faster for the occasional user
that does actually browse to it! :eek:)

Any help appreciated - I wasn't sure whether the solution to this would be
in the code or possibly within IIS so please excuse my posting if this is
the incorrect group.

Regards

Rob
 
K

Karl Seguin [MVP]

Cache normally referrers to things like the caching API and OutputCache. I
certainly hope that if your site is highly static, you use OutputCache a lot
to help the overall performance.

However, when talking about intial load, this is related to ASP.NET's Just
In Time (JIT) compilation. If you open up:

C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\CONFIG\machine.config
(recommend you back it up first)

and do a searhc for <processModel there are a lot of settings (all well
documented in the same file) you can change to dictate when ASP.NET recycles
itself.

If you are running IIS 6.0, there's a tab that controls many of these
settings also (under the application pool properties)

Alternatives:
-You could set up a scheduled task that simply hits one of the aspx pages
every 30 minutes or so...
-ASP.NET 2.0 has a number of compilation features, some of them do away with
the problem you mention

Karl
 
R

Rob Meade

...
Cache normally referrers to things like the caching API and OutputCache. I
certainly hope that if your site is highly static, you use OutputCache a
lot to help the overall performance.

Erm nope - thats a new one for me - should I just F1 - "outputcache" or do
you have a small example I could use?
However, when talking about intial load, this is related to ASP.NET's Just
In Time (JIT) compilation. If you open up:
yep

and do a searhc for <processModel there are a lot of settings (all well
documented in the same file) you can change to dictate when ASP.NET
recycles itself.

If you are running IIS 6.0, there's a tab that controls many of these
settings also (under the application pool properties)

I am yes, so perhaps I should look here - or do I need to do both?
-ASP.NET 2.0 has a number of compilation features, some of them do away
with the problem you mention

Its written in ASP.Net 2.0 -so again if you have any examples, or a URL you
could point me to for that I would be very grateful.

Thank you for your reply Karl.

Regards

Rob
 
R

Rob Meade

...
And don't forget to disable debugging in web.config.

Does that still apply in .Net 2.0? My previous experience from using Visual
Studio 2003 was basically a case of building the application in either DEBUG
or RELEASE mode, my understanding was that it would only use the settings in
the web.config file if it had been built in DEBUG mode.

In VisualStudio 2005 the only build option is DEBUG, however there's an
option to "Publish" the project- I had assumed, and possibly incorrectly,
that you were always in DEBUG mode until you published, at which point
VS2005 would change this to effectively a RELEASE build.

Any info on this would be appreciated.

Thanks for your reply.

Regards

Rob
 
K

Karl Seguin [MVP]

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
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top