[Phần 1]High performance in Drupal: Give your site a boost

[Phần 1]High performance in Drupal: Give your site a boost

Welcome to part 1 of our series on High Performance Drupal.

Why is my Drupal site slow?

Drupal is a highly flexible CMS with great community support in the form of drop in add-ons (contrib modules).

All this freedom means it's really easy to create awesome, great looking websites at the expense of some out-of-the-box performance.

Luckily with a few tweaks any performance penalty can be eliminated, making Drupal lightning fast!

Drupal basics

Drupal has a few built-in options which can quickly give your site a boost, so let's start there.

Turn off unsused modules

It may seem counterintuitive but any enabled modules take time to run even if they aren't doing anything, so turn off any modules you don't need.

[Phần 1]High performance in Drupal: Give your site a boost

Turn on aggregated CSS

Enabling this option will shrink and cache all of your beautiful CSS and help speed up the site for your users.

Turn on aggregated JavaScript

Similar to aggregated CSS, this will optimise your JavaScript making it download and run much quicker.

Cache pages for anonymous users

This will really speed things up if you get lots of anonymous traffic, but won't have any effect for logged-in users.

Cache blocks

Turning this on will speed up some of the common content components on each page by caching them, but it can have a few side effects so test it thoroughly! The Block Cache Alter module offers more fine-grained control with this option.

High performance modules

Entity Cache

This module adds automatic caching to content, comments, files, categories and even users and if you're only using contrib modules it won't have any side effects on your site.

If you've developed your own modules which update content directly then you may have to do some tweaking to get it to play ball.

Memcache

Drupal 7 provides a swappable caching architecture. The default is to use a number of `cache_*` tables in your Drupal database, but this has some performance drawbacks as it puts unnecessary stress on your database.

You can offload the cache storage to Memcache or similar modules such as APC and Redis. Because they store everything in memory they're much faster than your database which can now focus on loading and saving all that important content.

Using this module requires a bit of configuration and you must have the corresponding service and PHP library installed on your hosting. Check out the memcache installation guide for more info.

Views content cache

The Drupal views module is a really powerful way to pull together all kinds of content and aggregated data.

Unfortunately it comes with an all or nothing approach to caching, which can be problematic if your content changes frequently.

Here's where Views content cache comes in; it caches your views content and lets you specify the conditions for how and when the cache should be cleared, such as when a blog post is updated or a new comment is added.

Content delivery network

When a user views your site their browser loads the HTML content followed by each of the CSS, JavaScript and image files on the page.

Not only will all these requests impact your web server, but as browsers only load a couple of files at a time it can really slow down your pageload times.

A content delivery network is a service which hosts your static content under a different domain name, which has a whole bunch of benefits:

  • Users get your files quicker because they can load content from different domains in parallel.
  • User requests are smaller (and so even quicker!) because they don't need to send along any of the cookies from the main site.
  • Your webservers can focus on serving content as all the static files are coming from somewhere else.
  • You can reduce latency by serving content from servers which are geographically close to your customers, this works best if you have a diverse global audience.

Lightning fast code

Part 2 of our High performance drupal series covers best practices and optimisations for making your custom modules lightning fast!

In the meantime get in touch if you're interested in Drupal training or would like us to peer review your code.

Bạn thấy bài viết này như thế nào?: 
No votes yet
Ảnh của Tommy Tran

Tommy owner Express Magazine

Drupal Developer having 9+ year experience, implementation and having strong knowledge of technical specifications, workflow development. Ability to perform effectively and efficiently in team and individually. Always enthusiastic and interseted to study new technologies

  • Skype ID: tthanhthuy

Tìm kiếm bất động sản

 

Advertisement

 

jobsora

Dich vu khu trung tphcm

Dich vu diet chuot tphcm

Dich vu diet con trung

Quảng Cáo Bài Viết

 
Biến Profile Facebook thành bức ảnh ghép độc đáo!

Biến Profile Facebook thành bức ảnh ghép độc đáo!

Mời bạn xem thêm bài viết liên quan: 30 giây cho một trang Profile độc đáo - đã xuất hiện những công cụ hỗ trợ làm nên trang profile thành bức ảnh ghép độc đáo như trên!

Hé lộ nhà sản xuất màn hình iPhone 5 mới

Hé lộ nhà sản xuất màn hình iPhone 5 mới

Trang Macotakara.jp cho biết, hai nhà sản xuất màn hình Sony và Hitachi đang bắt đầu trong quá trình sản xuất màn hình 4-inch cho iPhone 5.

day con kieu nhat

Dạy con kiểu Nhật - mẹ Việt áp dụng như thế nào để con thông minh.

Phương pháp nuôi dạy con theo kiểu Nhật từ lâu đã được nhiều mẹ Việt đánh giá cao bởi tính ưu việt và hiệu quả nổi bật. Tuy nhiên, làm sao để áp dụng cách nuôi dạy con của người Nhật

Công ty diệt chuột T&C

 

Diet con trung