[thelist] Variable Stylesheets?(sorta long. . .)

Don Makoviney don at aspalliance.com
Tue Dec 4 20:22:35 CST 2001


Martin wrote:
> In ASP, would there be any wisdom in doing the browserdetect in the
global.asa file and storing
> the result in a session variable to reduce processor cycles for each page
view? Any thoughts?

Depending on the traffic, it may or may not be a good idea. Chances are the
processor would have to work harder to store each session variable (sessions
are EXPENSIVE - much more expensive than serving a few extra "k" per page)

Given that a session default timeout in an ASP Application is 20 minutes,
consider the following scenario:

===============
**At this moment
50 users come to site
--------------------
so you have 50 users on your site
and you have 50 sessions (this seems fine right?)

(but. . . . .)
===============
**5 minutes later
40 users leave
50 users arrive
-------------------
# of users: 60
# of sessions: 100 (the other sessions are remaining until they time out)

(it gets worse. . . .)
===============
**10 minutes later
50 users arrive
100 users leave
-------------------
# of users: 10
# of sessions: 150

(and the carnage continues. . . .)
===============
15 minutes later
50 more users come to the site
50 users leave
-----------------------------
# of users: 10
# of sessions: 200

(your server is now officially begging you for mercy)
===============
19 minutes 45 seconds later
50 more users come to the site
50 users leave
-----------------------------
GRAND TOTAL AT 20 MINUTES
# of users: 10
# of sessions: 250
YIKES! Look at all that wasted server memory holding state for people who
aren't even there!
-----------------------------

This is a possible (and very likely) scenario for a small to medium
trafficked website (this is about the average amount of traffic I get on
www.Makovision.com/). If you scale up to the thousands or tens of thousands
you can see how this could become a nightmare REAL fast. Generally sessions
are a bad thing.
------
See the following articles for a closer look:
"Session Overview & Myths"
http://www.learnasp.com/learn/sessionoverview.asp
"Databases and Sessions.... Just Say No!"
http://www.learnasp.com/learn/nodbsession.asp
------

Thankfully ASP.NET (which is due out anytime) takes care of ALOT of the
problems with sessions. (http://www.asp.net/) Once people begin migrating to
ASP.NET you will see less and less session issues.

Hope that helps!

Don Makoviney
MAKOVISION.COM "Handpicked News For Web Developers"
http://www.makovision.com/
Free WebDev/Usability Newsletter
http://www.makovision.com/subs/







----- Original Message -----
From: "Robert Goodyear" <rob_goodyear at yahoo.com>
To: <thelist at lists.evolt.org>
Sent: Monday, December 03, 2001 11:04 PM
Subject: Re: [thelist] Variable Stylesheets?


> Don't know if this is veering off-topic or swerving back on-topic ;-)
but...
>
> In ASP, would there be any wisdom in doing the browserdetect in the
global.asa file and storing
> the result in a session variable to reduce processor cycles for each page
view? Any thoughts?
>
> /rg
>
> --- martin.p.burns at uk.pwcglobal.com wrote:
> > >Yes, ALA has it's own version of this sort of, the style
> > >switcher by Paul Sowden, but that just selects between
> > >stylesheets already made, to give total control to the
> > >user, you need server side scripting. Or user style sheets,
> > >but seriously... how many users are going to know how to
> > >use them?
> >
> > Depends on your audience I think - the more aware of the technicalities
> > the users are, the more you can give them access to (and with less
> > explanation).
> >
> > So for a general audience, you might give them an "Enlarge/Reduce
> > text" option. For a web-dev audience such as ALA's or evolt's, you'd
> > give them a much wider range of elements to play with. And what you
> > might do is have a nice preview which lets you experiment a bit before
you
> > saved a preference.
> >
> > Of course, you'd need to explain what all the non-standard elements
do...
> >
> > Cheers
> > Martin
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> Buy the perfect holiday gifts at Yahoo! Shopping.
> http://shopping.yahoo.com
>
> ---------------------------------------
> For unsubscribe and other options, including
> the Tip Harvester and archive of TheList go to:
> http://lists.evolt.org Workers of the Web, evolt !
>





More information about the thelist mailing list