0

I'm facing issues on my every drupal site when i test my website in Google page speed insight . I have configured Advagg module and followed but not succeed.Issues are below:

  1. Eliminate render-blocking JavaScript and CSS in above-the-fold content.
  2. Leverage browser caching.
  3. Enable compression.

Sometimes (1) can be fixed by advagg setting but (2) and (3) need configuration in .htaccess. Can anybody provide me solution?

1

With AdvAgg enabled go to the status report page admin/reports/status. It should offer advice on how to fix gzip and browser caching for css/js aggregates. Also see the readme, under troubleshooting there are some tips for getting apache to do what you need it to.

If advagg doesn't report any issues then check and see what kinds of resources google is complaining about in terms of browser caching (.jpg) and compression (fonts). Also remember that if these are coming from an external domain (google analytics) there isn't a lot you can do as you don't control that server.

Edit: Guide here - https://groups.drupal.org/node/517292. It's the AdvAgg Readme file as well.

0

As you told you can Handle Aggregation of JS and CSS by AdvAgg but for Enable compression and Leverage browser caching Read this article about Leverage Browser Caching for Images, CSS and JS.

Add these lines to your .htacess file.

## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType application/javascript "access 1 month"
ExpiresByType application/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 2 days"
</IfModule>
## EXPIRES CACHING ##

Also, you can try

<FilesMatch "\.(jpg|jpeg|png|gif|swf)$"> Header set Cache-Control "max-age=604800, public" </FilesMatch>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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