Drupal Performance Settings in Code

After launching a Drupal site, one of the first things on the checklist is to turn on CSS and JS caching. This really helps speed up loading times, you just have to remember to clear the cache if you update the theme on the live site.

However, I've always been frustrated by the fact that these helpful settings get pulled into the development environment whenever the production databased is pulled in. You pull in the database, start editing a CSS file and can't figure out why nothing's changing. Then, you finally remember to go and turn off CSS and JS caching.

So I finally decided to override these settings once and for all in the site's private settings file (the one that includes the local database name and password instead of keeping those in settings.php).

It's a simple two-liner that will save much time and frustration:

$conf['preprocess_css'] = FALSE;
$conf['preprocess_js'] = FALSE;

Back to Blog

Commentaires

Thanks for the info but you could have mentioned that comment the two -liner or change the "FALSE" to "True".

That would help more for the readers.

With regards
Mohanraj Thangarasu

Poster un nouveau commentaire

Le contenu de ce champ sera maintenu privé et ne sera pas affiché publiquement.
  • Les adresses de pages web et de messagerie électronique sont transformées en liens automatiquement.
  • Tags HTML autorisés : <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Les lignes et les paragraphes vont à la ligne automatiquement.

Plus d'informations sur les options de formatage