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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T03:56:25+00:00 2026-05-31T03:56:25+00:00

I have written a simple Magento plugin that simply lists all sub categories that

  • 0

I have written a simple Magento plugin that simply lists all sub categories that are enabled from a given parent id.

The user simply selects a parent category id from the admin using the plugin tab i have created.

To speed things up i have added block caching to the plugin using the following code

 $this->addData(array(
            'cache_lifetime' => 86400,
            'cache_tags' => array(Mage_Catalog_Model_Category::CACHE_TAG)
        ));

This works well so far, as if a sub category is enabled / disabled the cache invalidates and is replaced. However if i change the parent category id in the admin changes are not seen until the whole block cache is refreshed using system->cache managment.

What i would like to do is have a method where by when a user clicks save in the admin the cache is flushed for just this one block rather than refreshing everything.

How would i go about this ? i am thinking some sort of event observer on the save event in adminhtml? however i wouldn’t know how to do this.

I am interested on what thoughs / suggestions other people may have.

Many thanks

Ian Cassidy

  • 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-31T03:56:26+00:00Added an answer on May 31, 2026 at 3:56 am

    You can use an Event Observer to clean cache. You can follow this tutorial to setup your observers, and then observe the catalog_category_save_after event.

    To clear cache, use Mage::app()->getCacheInstance()->cleanType(Mage_Catalog_Model_Category::CACHE_TAG); in your Observer Model.

    PS: maybe you have to setup your <events> into <admin> or <adminhtml> instead of <globals>.

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

Sidebar

Related Questions

I have written a simple WCF service that accepts and stores messages. It works
I have written a simple jQuery.ajax function which loads a user control from the
I have written a very simple bash script to help me migrate from dev
I have written a very simple WCF service, that worked fine (code below), then
I have written a simple application that displays a list of candidates for a
I have written a simple jQuery script that changes the hash tag of a
I have written a simple WCF web service in C# which returns records from
I have written a simple perl script to read a line from a .csv
I have written this simple C program that changes the rotation file name. Eg:
I have written a simple program that does autocorrelation as follows...I've used pgi accelerator

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.