Question

  • 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.

Was it helpful?

Solution

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.

OTHER TIPS

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

I find "HOW TO SPEED UP YOUR SITE AND GET A YSLOW GRADE" is useful for me. Hope this help.

Paste this code bottom of .htaccess file

RewriteEngine On
# BEGIN Mod Header

ExpiresActive On
# Turn on Expires and set default expires to 10 years
# END Mod Header

# BEGIN Cache Control

Header set Expires "Thu, 15 Apr 2012 20:00:00 GMT"
Header unset ETag
FileETag None

#END Cache Control
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top