drupal 6 performance tips - core drupal performance tutorial

Post on 28-Jan-2015

110 Views

Category:

Technology

2 Downloads

Preview:

Click to see full reader

DESCRIPTION

This tutorial/presentation walks you step by step through configuring your Drupal 6 site for best performance using the core Drupal performance configuration. Topics are excerpted from my book Drupal 6 Performance Tips.

TRANSCRIPT

Drupal CorePerformance

TutorialPresented by Trevor James

Trevor James | Drupal Developer | drupal6performancetips@gmail.com | USA

http://www.packtpub.com/drupal-6-performance-tips-to-maximize-and-optimize-your-framework/

Trevor James | Drupal Developer | drupal6performancetips@gmail.com | USA

AuthorTrevor James | Drupal Developer & Webmaster | http://variantcube.com/

Trevor has been designing Web sites for over 13 years, specializing in HTML, CSS, ColdFusion, and has worked with Drupal intensively for over 2 years.

Trevor is interested in all aspects of Drupal including best methods of developingDrupal themes, Drupal site performance, and using CCK, Views and Panels to developFrontend interfaces to support data intensive Web sites.

Trevor is currently working on a number of Drupal related projects for non-profit, Education-based and small business organizations.

Trevor created an 11.5 hour video tutorial series comprising 114 lessons titledIntroduction to Drupal 6 for VTC (Virtual Training Company) in 2009. The videos areAvailable here:

Trevor James | Drupal Developer | drupal6performancetips@gmail.com | USA

Configuring Drupal core performance1. Login to your Drupal site as the admin user #1.

2. Navigate to Site Configuration > Performance (/admin/settings/performance)

3. The main core Performance page will load – on this page you’ll find configurationsettings for page caching; page compression; block caching; and for optimizingCSS and Javascript files.

Trevor James | Drupal Developer | drupal6performancetips@gmail.com | USA

Page caching1. Under the Page cache heading Drupal gives you a brief explanation of core

page caching. Core page caching will affect your anonymous users. By cachingyour Drupal pages you can significantly increase page load times for youranonymous site visitors.

2. There are 3 caching modes in Drupal core: Disabled; Normal; and Aggressive.

3. We’re going to choose the Normal radio button selection – this is therecommended core caching mode for Drupal production sites. It hasminimal impact on any contributed modules you may have enabled.

Trevor James | Drupal Developer | drupal6performancetips@gmail.com | USA

Page caching contd.4. If you select Aggressive caching bear in mind that some contributed

modules may not function correctly. If this is the case usually the contributed module will show a “flag” here to warn you of any possible side effects.

5. Choose a Minimum cache lifetime for your cache mode. This is the minimum time that will pass before the performance cache on your site is emptied.

Trevor James | Drupal Developer | drupal6performancetips@gmail.com | USA

Minimum cache lifetimeA note here on setting your minimum cache lifetime. There’s always a tradeoff with

this configuration. If you set the cache lifetime high such as 1 day, you’llget better performance overall on your site since the site will cache pages for 24hours at a time.

However setting the configuration to 1 day will also prevent your anonymous usersfrom seeing new content on your site’s pages especially if they frequent your siteon a more regular basis such as hourly.

It’s better to start with a shorter cache lifetime (such as 1-3 hours) and see if that”helps to speed up your site’s performance while still offering your site visitorsnew content as it’s posted (or as closest to post time as possible).

Trevor James | Drupal Developer | drupal6performancetips@gmail.com | USA

Page compressionYou can set Drupal to compress pages by enabling the Page compression setting.

Page compression if enabled will help save bandwidth and improve download timeson your site. Just be careful if you are also compressing pages via your Webserver. If this is the case the 2 configurations may conflict.

If you are using Page compression already on your Web server you do not need to setDrupal to compress pages here.

Trevor James | Drupal Developer | drupal6performancetips@gmail.com | USA

Block cachingYour Drupal core performance configuration also allows you to either enable

or disable Block caching.

If you do enable block caching, the performance increases here will mostlyBenefit all of your site’s users including both anonymous and authenticated users.

Trevor James | Drupal Developer | drupal6performancetips@gmail.com | USA

Optimize your CSS filesIf you have created a custom theme for your Drupal site you may be using a bunch of

CSS files to control your theme styling. For example you might have a main“style.css” file as well as specific stylesheets for your Views and blocks; print stylesheets for your printer friendly content; and browser specific stylesheets for IE,Firefox and/or Safari.

At load time your site’s theme can use valuable resources having to load each of thesestylesheets and all of their code. Drupal provides a method of optimizing theCSS load time by compressing all of the CSS into one stylesheet that gets loadedand cached in the site visitor’s browser session.

The CSS files are aggregated and compressed into a single file if you select to enableCSS files optimization here on your main Drupal performance page.

Trevor James | Drupal Developer | drupal6performancetips@gmail.com | USA

Optimize your Javascript filesLike enabling your CSS optimization, you can also select to optimize your Javascript

files. Again this will come down to how many Javascript files you are runningon your site. If you are loading many JS files then you will most likely want toenable this optimization. If you only have a couple JS files in your site then youcan safely ignore this setting.

Like all Drupal core performance settings try each configuration out on your site andsee if it makes a large difference in site performance. You can enable these coreperformance settings and then use a module such as Development (discussed indetail in Drupal 6 Performance Tips) to monitor page load times and queries. Youcan then compare the load times when you have the settings enabled and whenyou have them disabled.

Trevor James | Drupal Developer | drupal6performancetips@gmail.com | USA

Clear your performance cacheFinally on the Drupal core performance configuration page you’ll notice that there

is a button at the bottom of the page that allows you to clear cached data.

This is an additional option to allow you to manually clear your Drupal cache beforeyour minimum cache lifetime cycle runs. You have full control over your core cache with this button – you can clear it at any time as long as you are logged in as your super user #1 admin account.

Trevor James | Drupal Developer | drupal6performancetips@gmail.com | USA

Sample Chapter and ArticlesVisit the Packt Publishing Web site for a sample chapter from the book andArticles excerpted from the book – both chapter and articles are available asPDF downloads:

Sample Chapter 5: Using DB Maintenance and Boost: http://www.packtpub.com/files/5845_Drupal%206%20Performance%20Tips_%20SampleChapter.pdf

Articles:

Drupal 6 Performance Optimization Using Throttle and Devel Module

Drupal 6 Performance Optimization Using Views and Panels Caching

Trevor James | Drupal Developer | drupal6performancetips@gmail.com | USA

What you will learn from the book• Upgrade your Drupal site – both full version upgrades and security patches

• Backup and maintain your Drupal 6 site using core and contributed modules

• Run core Drupal page compression, CSS and JS compression, and use Drupal corepage caching

• Use the Development (Devel) module to monitor page loads and queries

• Use the Boost module for anonymous page caching

• Install and use Memcache API, Authcache, and Advanced Cache modules

• Configure a Drupal multisite environment

Buy the book nowat Packtpub.com

The title is also available viaAmazon.com; and via links on my

Web site, variantcube.com

Trevor James | Drupal Developer | drupal6performancetips@gmail.com | USA

http://www.packtpub.com/drupal-6-performance-tips-to-maximize-and-optimize-your-framework/

top related