0

I need to cache a page (a user page ) and this page contain a follow button for logged in members and comments block.

How to cache this page ?
Suggestion 1 :
the page is cached until an action happens in the page then delete the current cache ? Does this Solution cause a high I/O Performance on the server

*or there * is another way ?

KJA
  • 743
  • 3
  • 9
  • 21
  • Why do you need to cache the page? Queries, construction, ...? – Karl Lorey May 27 '13 at 15:13
  • @lorey I need to cache whole page, file cache. do I have to split the page into boxes and cache the boxes ? – KJA May 30 '13 at 12:41
  • My question was why do you need to cache the page since this is important to answer your question right. You have to give more details on database access or performance intensive operations going on to get a good way to cache as an answer. – Karl Lorey May 31 '13 at 10:52

1 Answers1

1

The answer depends on which storage adapter you want to use and other implementation details. Since you're asking an unspecific question, I can only answer unspecifically:

I wildly guess that your queries are expensive and you therefore should cache them in the first place. An example on how to do this can be found here: http://samsonasik.wordpress.com/2012/09/27/zend-framework-2-using-zendcache-and-hydratingresultset-to-save-database-resultset/

Altough I wouldn't recommend to do it in your (guessed) case, you can find out more about caching a whole site here: How to approach caching in ZF2

More about n genralZend\Cache

Quick start: http://framework.zend.com/manual/2.2/en/modules/zend.cache.storage.adapter.html#quick-start

Examples on how to use Zend\Cache can be found here: http://framework.zend.com/manual/2.2/en/modules/zend.cache.storage.adapter.html#examples

Community
  • 1
  • 1
Karl Lorey
  • 1,536
  • 17
  • 21