Tell me more ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

My site will run on D7. but it will too slow. i want to compress (gzip) js and css. I have check my site on https://developers.google.com/speed/pagespeed/insights and it will told me for compression of js can css files.

share|improve this question
1  
Regarding "it will run too slow", I'm curious how slow you're talking about. Compressing js and css is going to shave maybe 0.5 seconds off of your page load at best. Arjan's answer includes "Cache pages for anonymous users" which is going to dramatically improve performance if your pages have been loading over 1-2 seconds. – Johnathan Elmore Feb 6 at 15:45

2 Answers

up vote 4 down vote accepted

The easiest way is to go to Configuration > Development > Performance (admin/config/development/performance), and enable:

  • Cache pages for anonymous users
  • Cache blocks

And also:

  • Compress cached pages
  • Aggregate and compress CSS files
  • Aggregate JavaScript files

For websites with mostly anonymous (not logged-in) visitors, this is often sufficient. Note that if you enable compression in Drupal, you should not enable page compression on the web server level (Apache) as well.

share|improve this answer

If you are running into a bit performance problem, the following two Q/A are worth to read:

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.