8

I am trying to create & store custom cache using script in magento 1. Is their any way we can implement it ?

1 Answer 1

2

create your own cache type by declaring the following in your config.xml

<global>
    <cache>
        <types>
            <custom translate="label,description" module="module">
                <label>Custom Cache</label>
                <description>This is my custom cacge</description>
                <tags>CUSTOM_CACHE_TAG</tags>
            </custom >
        </types>
    </cache>
</global>

Hope This Helps!

Update: For more details refer to this link https://magently.com/blog/custom-cache-in-magento/ Update:- Retrieving Data

Mage::app()->loadCache($id);

Deleting Cache

Mage::app()->removeCache($id);

Checking If Cache Is Enabled

Mage::app()->useCache('collection');  //check if cache group is enabled or not
8
  • Thankyou for the answer, but i also want to store data in it. Jul 10, 2020 at 5:40
  • wait am putting a source link in my ans now checkout the links
    – Pramod
    Jul 10, 2020 at 5:42
  • Let me try into script :) Jul 10, 2020 at 5:45
  • yeah sure give it a try
    – Pramod
    Jul 10, 2020 at 5:47
  • @Chiiku How can i make sure that custom cache is created & stored ? Jul 10, 2020 at 5:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.