Welcome Guest, Not a member yet? Register   Sign In
Checking for non-logged in users before showing cached pages [Adv.]
#7

[eluser]Damien K.[/eluser]
Quote:Actually, I am a die hard performance guy that can’t stand page loads over 40ms.

Okay, sounds fair.

Quote:What if I were to tell you that not caching would result in a 10 fold increase in the required resources? Memcache and partial page caching is what takes a site from 100 pages a second to +1,000.

If I recall correctly, this is O(n) complexity. In computer theory, it means insignificant re: performance Smile.

Quote:So back to the blog post. First we check for isset($_COOKIE[‘logged_in’]). If it is found then we know that this user has probably logged in so we can justify wasting our resources to load the DB, sessions, and user lib to check for sure. If this cookie is not found then we know they couldn’t possible be logged in so we show the cache.

So if a user creates a $_COOKIE[‘logged_in’] then our system wastes time to show them fresh pages (but still don’t see edit links), admins with valid $_COOKIE[‘logged_in’] see fresh pages (with links), and everyone else sees caches.

Looks like you have solved your own problem? You're looking for an alternate implementation? If you're thinking about doing this in CI, you may have to fight the framework.


Messages In This Thread
Checking for non-logged in users before showing cached pages [Adv.] - by El Forum - 09-21-2009, 09:19 PM



Theme © iAndrew 2016 - Forum software by © MyBB