3

I am newbie to Magento. I'm learning to create my first module but I'm confused whether it's necessary to disable the cache or not.

If yes, please tell me how? Thanks,

1
  • 2
    Not developing on your live website are you? Commented Sep 7, 2014 at 20:16

3 Answers 3

1

Yes, it's necessary because:

When one store magento is created, all the data are availably GEN. So if we don't delete or change or disable the old GEN, your system will read the old GEN and nothing changes to your store.

To learn how to disable cache before creating the first magento module. Take it as reference: http://www.mage-world.com/blog/lesson-1-guiding-to-create-the-first-module.html

1
  • Thank @Hong Nguyen, the source you recommend is very easy-understanding, i can easily disable the cache now!
    – hgfihif
    Commented Sep 9, 2014 at 9:45
2

Note: You did not "need to disable the cache before creating module". But after uploading this module it didn't have "immediate effect till you have flushed magento cache". Well, this is because magento manages xml and phtml files using its caching system. So you need to cache clear after creating a module in magento.

Magento generally has config,layout,block_html,translate types cached it's cached from xml and phtml files. So you need to clear cache

In Magento we have the following cache types:

 1. Configuration (non-layout XML files)
 2. Layouts
 3. Blocks HTML output (Page blocks like headers, footers and callouts)
 4. Translations
 5. Collections Data
 6. EAV types and attributes
 7. Web Services Configuration

Note:

If you have made any changes in phtml and xml files, eav attibute & collection models etc. on a cache enabled system then you need to flush cache to see the effect of their changes.

how to enable cache programmatically?

Read about the concept of cache

2
  • can tell who and why give me downvote?
    – Amit Bera
    Commented Sep 6, 2014 at 4:13
  • I didn't downvote, but I wonder why your posts mix the use of inline code spans (text like this) and regular text. It makes it very difficult to read and it serves no purpose.
    – pspahn
    Commented Sep 7, 2014 at 19:05
1

It is not necessary but if you can disable then it will help you to develop application faster.

If you are developing phase of your project then you to do this thinks keep in mind.

  1. Disable Cache. Y? Because The main use of cache is when you go live for your site and it will render data as fast as possible for that we are using cache. when you developing your site then it's very tedious like each time you change then you must refresh the cache as @Amit said Magento Store All configuration, Layouts, Blocks HTML Output, Translations etc.

  2. So once your site is ready with testing then you can enable cache and deliver to your client. but My suggestion is that when you are in developing phase then you must disable Cache.

4
  • One of the most annoying parts of module programming is a need to constantly clear cache to see certain results because they're otherwise stuck in cached html blocks or to clear stuck config changes after you've changed .xml files. Easier just to run cacheless for the duration till you're complete. Commented Sep 7, 2014 at 20:22
  • So that's y when u r in developing phase then disable cache
    – Keyul Shah
    Commented Sep 8, 2014 at 3:14
  • Yes. Nothing so annoying as making a change and nothing happens till you remember to go over to cache management and flush the stuck item. Commented Sep 8, 2014 at 4:10
  • yes true if we are using varnish cache then we have to also flush varnish cache also
    – Keyul Shah
    Commented Sep 8, 2014 at 4:36

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.