Welcome Guest, Not a member yet? Register   Sign In
caching question
#1

[eluser]natefons[/eluser]
i know that using output caching kind of saves on recources and what not, since alot of things on the page get cached (mysql queries being displayed etc etc)

i dont really have a firm grasp of it all, and im wondering, if i have a user login system on a page that gets cached...will that login get cached as well?


i.e
if john doe logs in, and the site displays john does details...

if some one else visits the page as well...will they also see john does info due to caching?


or will the use of cookies prevent such things?
#2

[eluser]WanWizard[/eluser]
Standard output caching in CodeIgniter works per URI, and caches the entire page. When someone requests the same URI, the entire page (as-is!) will be served from cache.
This is only useful on a completely static page, which doesn't happen to often.

There are solutions using third party libraries that allow partial caching, were you are in control as to what exactly is cached, and for how long. If you build your page from different views, you can cache de views containing header, footer, and text, and p.e. dynamically build the menu.
#3

[eluser]pickupman[/eluser]
Wanwizard is correct. The built in caching of CI is weak in the fact that it renders and saves the html for page output. CI will check the cache for a matching URI. If found no further php will be processed. This cache system does not work if you have something dynamic in the page like login/logout status etc. Query caching is decent, however, those DB caches do not expire and have to be deleted manually. There exists two strong partial cache libraries. In my signature there is a file based cache library that works really easily. There is also Multicache library that supports RAM caching via APC or memcached. If you have full server access, RAM caching maybe the fastest. In a shared environment, file based will be best.
#4

[eluser]natefons[/eluser]
thanks
will look into them both!




Theme © iAndrew 2016 - Forum software by © MyBB