I have been working on a module for Drupal 6.1 and every time I change some code in the file, I have to go back to Administer > Site Configuration > Performance > Clear cached data.
I do NOT have caching turned on.
Caching mode: Disabled
Minimum cache lifetime:
Page compression: Disabled
Block cache: Disabled
Optimize CSS Files: Disabled
Optimize Javascript files: Disabled
Still, I am forced to clear cache with every little module code change. I am just playing with the example node module so it's very basic code. It looks like:
function mytestmodule_node_info() {
return array(
'mytestmodule' => array(
'name' => t('Test'),
'module' => 'mytestmodule',
'description' => t("This is a test"),
'help' => t("Help test"),
'has_body' => FALSE,
'title_label' => 'Name your test (for your reference)'
)
}
The page that I am trying to see the change on is Create Content. I see there is a content type called "Test". Now, If I go into my code and change it to "Test2", and save the file, and I go back and reload the page, it still says "Test". I tried clearing my browser cache. Same. Tried logging out and back in. Same. Tried loading the page on a different browser, still says "Test".
Finally, I go into the "Clear cached data" in the Administer and finally it gets updated to Test2.
What is going on? How can I really TURN OFF caching? I don't want to click that button every time.
Thanks!
Comments
no expert on drupal internals...
But I believe this is intended behavior: some things (module node info, views, etc) are cached no matter what the settings performance.
This is probably the menu
This is probably the menu system's cache, which always caches. Unfortunately it's a fact of life when developing modules. I'd recommend installing the devel module and enabling it's devel block. That adds a quick and easy "empty cache" link for module development.
http://www.trailheadinteractive.com
I see. That is too bad. I
I see. That is too bad.
I decided to hack around it by modifying menu.inc around line 338:
changed by commenting out the rebuild condition:
Now it rebuilds the menu every time. It's slow, but it's easier for me to develop.
If you know of a better way to handle this, let me know! Gracias.
You could temporarily
You could temporarily implement hook_init() in your module and
Boils down to much the same thing really. But perhaps easier to turn menu cacheing on and off this way. You could even make a tiny custom dev module for this with a checkbox "force menu rebuild on each page load" on a settings page .. oh I must be bored ... ;-)
gpk
----
www.alexoria.co.uk
gpk
----
www.alexoria.co.uk
<?php cache_clear_all(NULL,
cache_clear_all(NULL, 'cache_menu');http://www.trailheadinteractive.com