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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T17:08:24+00:00 2026-05-21T17:08:24+00:00

I started using Zend Cache (APC backend) and all is well in terms of

  • 0

I started using Zend Cache (APC backend) and all is well in terms of returning cached values instead of hitting the Database each time. However, heres my problem:

$cache_key = 'getrebates_'.$operator_code;

if(PP_Model_CacheService::exists($cache_key)) {
    $cached_values = PP_Model_CacheService::load($cache_key);
} else {
   //hits the db    
   $cached_values = $this->getAll($operator_code);
   PP_Model_CacheService::save($cached_values, $cache_key);
}
return $cached_values;

Each operator has their own rebates which vary between operators, now if I change the database and need to clear the rebates for all the operators, how would I do this?

I can use $Cache->clean(), but that will clear the other caches (not just the rebate cache for each operator). If I loop through all operators:

foreach($operator_codes AS $operator_code) {
   $cache_key = 'getrebates_'.$operator_code;
   $cache->delete($cache_key)
}

That seems like alot of work for the cache. Is there a way to clear just a section of Cache.

//Something like:
$section_key = 'getrebates';
$Cache[$section_key][$operator_code];
$Cache->clearSection($section_key);

Is there any array structure to the APC cache or is it all cache key/value based?

  • 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-21T17:08:25+00:00Added an answer on May 21, 2026 at 5:08 pm

    You can apply tags to values stored in the cache. That way you can easily delete all cache entries which have a certain tag.

    $cache->save($huge_data, 'myUniqueID', array('tagA', 'tagB'));
    
    // clear all cache entries with tag tagA or tagC
    $cache->clean(
      Zend_Cache::CLEANING_MODE_MATCHING_TAG,
      array('tagA', 'tagC')
    );
    

    Refer to this page: http://framework.zend.com/manual/en/zend.cache.theory.html and the API for details about the clean method of Zend_Cache_Core: http://framework.zend.com/apidoc/1.11/

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

Sidebar

Related Questions

I have recently started using Zend Framework. I started developing on my local XAMPP
I've recently started using Zend Framework (1.8.4), to provide admin tools for viewing the
I have recently started using Zend Studio which has reported as warning the following
I just started using CodeIgniter after using Zend for a while. My new site
I have just started working on a project and I am using zend framework
I started working on a project in the mid. We are using Zend Framework,
Though this thread recommends using it, I've few concerns: I started with Zend Framework
I've started using Zend Framework and Studio for my projects and would like to
I just started learning Zend. I managed to get the basic working (using zf
I started using subversion for one of my projects and it would be absolutely

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.