views:

150

answers:

2
  • Use a Content Delivery Network (CDN)

  • Compress components with gzip

  • Configure entity tags (ETags)

  • Add Expires headers

If i don't have access to Apache configuration.

+1  A: 

Use a Content Delivery Network (CDN)

This involves changing your hosting (for at least some files)

  • Compress components with gzip
  • Configure entity tags (ETags)
  • Add Expires headers

You can either:

  1. Get access to your Apache configuration
  2. Get someone who does have access to it to change it
David Dorward
Can't we add Expires header in html <head> and gzip in php file?
metal-gear-solid
I have cpanel but don't how and where to set all these things.
metal-gear-solid
No. Maybe, but eugh. I've never touched cPanel.
David Dorward
A: 

If you have grade A on every other YSlow rule then you're doing pretty well already and don't need to worry about those items. By the way, you can create custom rulesets in YSlow that are more tailored to your needs and server setup. So if you can't change any of these things, just remove them from the rules that YSlow uses.

Use a Content Delivery Network (CDN)

You can add your site domain as a CDN in YSlow. The idea of this one is to store static components on different domains to increase "parallelisation" (downloading more files at once). If you are using limited hosting then you could open a separate account and host some files there on a different domain.

Compress components with gzip

You can do this in PHP, using ob_start('ob_gzhandler'); at the very start of your scripts. This is a little more resource intensive so use Apache if possible.

Configure entity tags (ETags)

Remove this from the rule list, it's not necessary in 90% of cases. Yahoo only says to remove them because in the rare situation you have multiple servers in the back-end, the same file might have a different ETag if it comes from a different server. When each file comes from one server then ETags are a good thing and removing them is detrimental.

Add Expires headers

If you have no access to the server then you probably won't be able to change this. Ask your host about it. You may be able to override the server setting in your .htaccess file. You'd need the mod_expires Apache module. This page has some usage examples.

DisgruntledGoat