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 7894729
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T07:28:11+00:00 2026-06-03T07:28:11+00:00

Is it possible to have two different cache instances for Zend_Cache ? For instance,

  • 0

Is it possible to have two different cache instances for Zend_Cache?
For instance, if I wanted to have a set of files that are stored forever unless I delete them and another set that gets invalidated every minute — could I do that?

Everywhere I look I always see only one frontend and backend configuration used.

Thanks!

  • 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-06-03T07:28:12+00:00Added an answer on June 3, 2026 at 7:28 am

    You simply create two different instances of Zend_Cache and stick them somewhere handy. I did something like this once, instantiating the cache instances in the boostrap, and just sticking them in the registry, like this:

    protected function _initCache(){
        $this->bootstrap('config');
        $config = Zend_Registry::get('config')->myapp->cache;
    
        $cache = Zend_Cache::factory(
          $config->frontend->name,
          $config->backend->name,
          $config->frontend->opts->toArray(),
          $config->backend->opts->toArray()
        );
        Zend_Registry::set('cache',$cache);
        return $cache;
      }
    
      protected function _initUserCache(){
        $this->bootstrap('config');
        $config = Zend_Registry::get('config')->myapp->othercache;
    
        $cache = Zend_Cache::factory(
          $config->frontend->name,
          $config->backend->name,
          $config->frontend->opts->toArray(),
          $config->backend->opts->toArray()
        );
        Zend_Registry::set('othercache',$cache);
        return $cache;
    
      }
    

    So, there’s really nothing about the design of Zend_Cache that limits the number of different caches you can have. You can configure them all independently, using whatever front-end and back-end you like for each.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two different PHP files that both write to the same file. Each
Is it possible to use Except() for two List's that have two different classes
Is its possible to have a javascript file that is aware of two different
Is it possible to have two different foci/focuses on X windows?
Is this possible to have two (or more) different kinds of cells to be
Is it possible to have two methods with the same name but different parameters
Is it possible to have two app.config files where one app.config serves as a
I have an action that renders two different view scripts based on whether the
I have two different versions of linux/unix each running cfengine3. Is it possible to
Possible Duplicate: Reading dll.config (not app.config!) from a plugin module. I have two different

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.