Welcome Guest, Not a member yet? Register   Sign In
How to cache output?
#1

[eluser]Computerzworld[/eluser]
Hello,
I want to cache my output using
Code:
$this->output->cache(n)
. Actually I want to cache the menu in the header which is a view file. What is the exact syntax of it? So, if user comes for the first time it should cache output & it will load that output from second time onwards. Thanks in advance...
#2

[eluser]pistolPete[/eluser]
[quote author="Computerzworld" date="1235498703"]Actually I want to cache the menu in the header which is a view file. [/quote]

CI's standard cache can only handle the caching of full pages.
Have a look at e.g. the following about partial caching:
- http://ellislab.com/forums/viewthread/104228/
- http://codeigniter.com/wiki/MP_Cache:_Si...s_of_code/
#3

[eluser]CrossMotion[/eluser]
What you want is Fragment Caching. I had this problem with a project a while ago, I found the following very useful:

http://codeigniter.com/wiki/MP_Cache:_Si...s_of_code/
#4

[eluser]Computerzworld[/eluser]
thanks for the reply...
how can i cache full page & load it from cache?
#5

[eluser]TheFuzzy0ne[/eluser]
The [url="http://ellislab.com/codeigniter/user-guide/general/caching.html"]CodeIgniter cache method[/url] in the Output class does it all for you.




Theme © iAndrew 2016 - Forum software by © MyBB