Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
Drupal is like an engine, a complex system with many moving parts working in conjunction with one-another to deliver power. By opening the metaphorical hood and working directly with the engine, using the right tool, a properly equipped site administrator can quickly perform potentially cumbersome tasks with ease. This chapter will cover a number of tools and techniques useful for performing low-level operations on a Drupal site. Out of the box, Drupal provides a number of caching mechanisms to improve site performance and avoid heavy or repetitive tasks.
For example, both the menus and the blocks are extensively cached and Drupal gives precedence to these caches over configuration stored in code. This can present a problem when developing modules as code changes will not be immediately shown on a site. Additionally, when transferring a site between hosting environments, cache settings for file locations and paths can cause problems when attempting to access the transferred site without clearing the cache which tends to result in an incomplete or broken site.
Log back into the site: admin, admin. Drupal provides an interface for clearing all caches deep within the Admin menu. If you go to Configuration>Performance, you see a button, Clear all caches. It's time-consuming to wade through the menus to find this button and sometimes there's no need to clear every cache, only a certain cache such as the menu or aggregated and compressed CSS files. Drush provides a mechanism to handle these issues with the Cache Clear command aliased as cc, drush cc --help.
The Cache Clear command takes an optional argument, the name of the cache to clear. If the argument is omitted, Drush will give a choice of the available caches, type: drush cc, and press Enter without any arguments. All will do the same as clear all caches and often this is used as a magic bullet to fix strange caching issues. Do be cautious however, as this will degrade performance for the next few page views until the caches are regenerated. Press 1 to clear all caches. The same command can be executed by specifying "all" as the argument.
To explicitly clear one of these caches either use drush cc, press Enter and type the number of the selection, or give the machine name of the cache to clear such as: drush cc menu. Caches typically have an expiration date and therefore have a chronological context. With that in mind, caches are not the only time-based mechanism that executes in Drupal. A cron job is a time-based event that executes some regularly scheduled operation such as: checking site updates, indexing site content with the search module, importing site content from a third-party, and so forth.
In Drupal 6, cron execution needed to be set up manually or leverage the contributed module poormanscron, which triggered these time-based events after a regular page load from a visitor. poormanscron was included in Drupal 7 Core eliminating the need for additional configuration or module installation. However, regardless of the mechanism that triggers them, sometimes it's useful to manually execute these time-based events. The drush command cron, which has no alias, runs all cron hooks for every active module in a given site.
The drush cron command takes no arguments or options: drush cron. Upon completion, feedback is given. On the topic of feedback, the Drupal logging system contains a vast wealth of feedback and debugging information from various side events.
Get unlimited access to all courses for just $25/month.Become a member
82 Video lessons · 101512 Viewers
61 Video lessons · 88272 Viewers
71 Video lessons · 72145 Viewers
56 Video lessons · 103904 Viewers
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Your file was successfully uploaded.