Yii Framework Forum: Advantages Of View(Page/fragment) Caching - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Advantages Of View(Page/fragment) Caching Rate Topic: -----

#1 User is offline   awebdeveloper 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 55
  • Joined: 29-September 12

Posted 20 January 2013 - 04:13 PM

What are advantages of view(page/fragment) caching. Unless you are doing too much of a calculation or large nested loops, I don't see much use in view caching. I might be missing a point here though.

Thanks
0

#2 User is offline   Joblo 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 689
  • Joined: 12-September 10
  • Location:Austria

Posted 20 January 2013 - 06:13 PM

Much better performance / saves resources for example if you have a complex frontpage:

Assume you cache the whole page:

- widgets/boxes/sidebar content: no need to initialize/run/render/loading views from the filesystem/db-queries
- no (or one, if you use dbcache) db-queries instead of several queries
(latest news, articles, checking users online, creating menu from db, checking permissions ...)
- checking current visible images / slideshow / operations ...
...

It's almost like your controller would output a static html instead.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users