Welcome Guest, Not a member yet? Register   Sign In
dynamic links with Web Page Caching?
#1

[eluser]derekt[/eluser]
I'm a novice coder but managed to roll-my-own CI-based auth. I'd like to use CI Web Page Caching to increase my site's performance, but caching the whole page obviously breaks my dynamic user "login" or "logout" links.

Could anyone point me to best-practices or documentation on a good approach to this situation?

My best guess on how to address this would be to cache the whole page which includes an empty "loginlinks" DIV, then use JavaScript to check for a cookie value set by auth, and insert the login or logout link into the div conditionally. From reading the forums I gather that partial-page caching might be another approach.

Would really appreciate any advice here!

Kind regards,
Derek
#2

[eluser]yacman[/eluser]
I would suggest with something unobtrusive technology first on the server layer like APC or memcache.

I would supplement with targeted useage of caching using something like the Cache spark.

Phil Sturgeon produced a great one.

Using cache within your application should target globally shared frequent functions.

Avoid adding complexity to developing your application when working on performance.

Performance should enhance both your time to code and your applications execution. If you have to create your own caching pattern with lazy load javascript etc. IMHO it's just asking for trouble, especially for the next guy.




Theme © iAndrew 2016 - Forum software by © MyBB