You are here: Re: how to cache pages with login names « PHP Programming Language « IT news, forums, messages
Re: how to cache pages with login names

Posted by lister on 02/18/07 21:58

On Feb 18, 9:23 pm, "petersprc" <peters...@gmail.com> wrote:
> Since the PHP script is run for each request, you can output the name
> in the session:
>
> header.php:
>
> <p>
> You are logged in as
> <?= htmlentities($_SESSION['userName'], ENT_QUOTES) ?>
> </p>
>
> On Feb 18, 4:17 pm, "lister" <listerofsme...@hotmail.com> wrote:
>
>
>
> > I'm fairly new to this web authoring lark, and I was pondering today
> > how to optimise my site for cacheing, but as far as I can see there is
> > no way to do it.
>
> > My site has a standard header that includes the option to either
> > "Login" or "Logout <username>". This header is generated by PHP
> > reading the session ID and looking up the corresponding username.
>
> > I guess I could cache the username in the user's session data to save
> > a DB lookup (or maybe even a cookie to save looking up any session
> > data at all). However, I still cannot see how I can ever cache the
> > resultant page since the header is user specific, even if everything
> > else is static?
>
> > How do other people handle this? Having the username at the top seems
> > a pretty common design, so I guess the problem must have been tackled
> > somehow?- Hide quoted text -
>
> - Show quoted text -

Yes, that's what I'm doing now (near enough).

My point was that many high hit websites cache the result of the php,
so that the script doesn't have to be run at all. I could not see a
way of doing that when user specific login details are displayed in
the header.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация