You are here:  » Google Pagespeed insights


Google Pagespeed insights

Submitted by wesse249 on Tue, 2015-06-16 18:48 in

Hello David,

I'm trying to optimize my site voor Google.

When i go to Pagespeed Insights and do the test i get the following messages:

Need to corrected:

Turn on resource compression and use browsercaching.

Is this possible?

Now i have a rate of 72/100

{link saved}

Greetings Jan Roel

Submitted by support on Wed, 2015-06-17 11:50

Hello Jan,

Sure - in your html/header.php look for the following code at line 4:

  header("Content-Type: text/html;charset=".$config_charset);

...and REPLACE with:

  ob_start("ob_gzhandler");
  header("Content-Type: text/html;charset=".$config_charset);

That will enable gzip compression of your output.

Cheers,
David.
--
PriceTapestry.com

Submitted by wesse249 on Wed, 2015-06-17 12:09

Thanks,

Is this also for browsercaching?

Greetings Jan Roel

Submitted by support on Wed, 2015-06-17 12:21

Hello Jan,

I've just looked at the following page;

https://developers.google.com/speed/docs/insights/LeverageBrowserCaching

The recommendation for this pagespeed response appears to be that Google would like to see caching guidance headers even if they indicate that content should not be cached. I've never included caching headers due to the dynamic nature of a price comparison site, but it would be no problem to include headers that are compatible with the frequency with which you are running your site's CRON process, so if this is daily, then caching headers to permit 24 hours caching might be appropriate, which can be done with a Cache-Control: maxage= header.

To add this for a value of 24 hours (86400 seconds), as an alternative to the replacement described in my previous post, have a go with:

  ob_start("ob_gzhandler");
  header("Cache-Control: maxage=86400");
  header("Content-Type: text/html;charset=".$config_charset);

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by stevebi on Thu, 2015-06-18 06:43

Hello David,

I have applied ob_start("ob_gzhandler"); .

Thank you for your support

Cheers

S