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

  • Home
  • SEARCH
  • 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 5963891
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:20:03+00:00 2026-05-22T19:20:03+00:00

I am using a code snippet to cache an entire page : <?php //

  • 0

I am using a code snippet to cache an entire page :

<?php

// Cache engine
// Cache everything outputed on the page for 2 minutes
// in the tmp folder

require_once 'Zend/Cache.php';

$frontendOptions = array(
   'lifetime' => 120,
   'automatic_serialization' => true,
   'cache_with_get_variables' => true,
   'cache_with_post_variables' => true,
   'cache_with_session_variables' => true,
   'cache_with_files_variables' => true,
   'cache_with_cookie_variables' => true
);

$backendOptions = array(
    'cache_dir' => '../tmp/'
);

$cache = Zend_Cache::factory('Page', 'File', $frontendOptions, $backendOptions);
$cache->start();

echo date("D M j G:i:s T Y");

?>

If I call the page using :
http://localhost/myapp/cache.php
it works PERFECTLY

If I call the page using with a get parameter :
http://localhost/myapp/cache.php?test=5
the page is not cached

I use ZF 1.11.0

Thank you for your help !

  • 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-22T19:20:04+00:00Added an answer on May 22, 2026 at 7:20 pm

    Actually it’s easy you have an error in you Frontend options, ‘cache_with_XXX_variables’ need to be in an array with the key ‘default_options’:

    $frontendOptions = array(
       'lifetime' => 120,
       'automatic_serialization' => true,
       'default_options' => array(
                'cache' => true,
                'cache_with_get_variables' => true,
                'cache_with_post_variables' => true,
                'cache_with_session_variables' => true,
                'cache_with_files_variables' => true,
                'cache_with_cookie_variables' => true,
            )
    );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am inserting an Image in the MediaStore cache using the following code snippet:
using the Code Snippet for sending email in VB.Net I have successfully sent an
I am using the code snippet below, however it's not working quite as I
Using the obsolete System.Web.Mail sending email works fine, here's the code snippet: Public Shared
I am using following code snippet, but its not working :-( //First four characters
I am using below code snippet to validate my input string with: only capital
I am validaing a xml using following code snippet. SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI); try
I'm having problems running the following code snippet using JavaScript and JQuery. listOfDisplayCategories is
I'm using code that I found on the CodeProject.com for a low-level keyboard hook
I've recently started using code coverage tools (particularily Emma and EclEmma), and I really

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.