Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7693025
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T20:59:18+00:00 2026-05-31T20:59:18+00:00

I want to try create something like Zend’s Server Pagecache. What I want to

  • 0

I want to try create something like Zend’s Server Pagecache. What I want to achieve is to store page output, so I guess it would be direct html, but with possibility to insert some dynamic data to page.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T20:59:19+00:00Added an answer on May 31, 2026 at 8:59 pm

    Output caching is a large subject. Do do it right, you need to think a bit on the design.

    Here are 2 ways. The code sample is just for explanation, it’s not a working solution.

    1. Block cache and dynamic composition. Probably the best way. Divide your page into several bloks. Each block should be generated by separate function/class. You can use Zend_Cache_Frontend_* objects to cache those blocks. Once Your application know what to display, in the controller You can compose the output using cached blocks and the dynamic parts.
    
        class CachedController extends Zend_Action_Controller
        {
    
        public function indexAction()
        {
            $this->_view->leftBlock = $this->leftBlock();
            $this->_view->rightBlock = $this->rightBlock();
        }
    
        protected function leftBlock()
        {
            // prepare left block, can use Zend_View if you like
            // use Zend_Cache to cache the block 
        }
    
    
        protected function rightBlock()
        {
            // prepare left block, can use Zend_View if you like
            // use Zend_Cache to cache the block
        }
    
        }
    
    /* VIEW SCRIPT */
    <html>
      <body>
        <div class="left">
          Left cached block here
          <?php echo $this->leftBlock; ?>
        </div>
        <div class="main">
          Do Your dynamic part here
        </div>
        <div class="right">
          Right cached block here
          <?php echo $this->rightBlock; ?>
        </div>
      </body>
    </html>
    
    1. Whole page cache with substring substitution. If you do not wish do divide the page into blocks, You can cache whole page (Also using Zend_Cache_Frontend_*), and then use PHP str functions to substitute or insert the dynamic part. You will need to capture output of the View rather then having it sent by the framework automagically (refer to docs on how to change this).
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I try to create something, where you can drop different things on it, like
I want my code to automatically try multiple ways to create a database connection.
If I want to try out something new in Ruby or Javascript, I love
I want to try something different, and am attempting to display an overlay on
I currently try to create classes for a paint-like WPF application. I have to
I want to structure my Flask app something like: ./site.py ./apps/members/__init__.py ./apps/members/models.py apps.members is
I want to create a collection of classes that behave like math vectors, so
I want to try to create a learning chess application as a school project.
What's the best way to achieve something like code folding, or the type of
I'm coding something like REPL Server. Request from users evaluates in such function: (defn

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.