OT: why do web BBS's and blogs get so slow?

Paul Rubin http
Mon Feb 2 12:51:34 EST 2004


Max M <maxm at mxm.dk> writes:
> >> Or even faster if "Hi <username>" was two gifs that could be loaded.
> > Please, don't lose accessibility for some petty speed gain.
> 
> I was talking about how to optimize for speed, and how designs can be
> changed for the purpose of speed.

You could also do it with client side javascript in a static page:
 
   <script>
   document.write("hi " + get_username(document.cookie))
   </script>

if the username is stored in a browser cookie.  More generality you
can simulate a client side include:

    <script src=username.js></script>

where the server responds to requests for username.js with

   document.write("hi [username]")

after determining the username from the sent cookie.  The server to
use cache control headers very aggressively to stop the browser from
showing the wrong name if someone logs off and then logs back in as
another user.  I remember cackling somewhat madly when I came up with
this, because it was after having spent about a whole day coding up
generating a messy page dynamically and realizing I could do the above
instead (more complicated situation of course).



More information about the Python-list mailing list