Emptying the Cache

Something that every new Drupal developer learns is that the cache table in the database can be emptied without ill effect to the integrity of the database or its data. In fact, when you're programming certain elements, such as the hook_menu function for a module, it is necessary to empty the cache from time to time. When developing Drupal, especially when making changes to the hook_menu function of a module or when dealing with filtered text, you usually need to clear the cache before your changes will become visible. Menus, variables, and other key elements are cached to improve the performance of the page-building process.

The Devel module offers a convenient link for developers so that they don't need to keep running database queries manually to clear the cache. With the Devel module enabled, an Empty cache link appears in the main navigation menu (devel/cache/clear).

■ Note There is almost no reason to clear the cache if you are not developing Drupal modules. But if you accidentally clear the cache, don't worry—you haven't hurt anything.

0 0

Post a comment