1

I am using a VPS which runs nginx+php-fpm. My blog is based on laravel.I am trying to optimize my site to pass webpagetests. I got "C-(72/100)" from Cache static content test.

I configured my nginx cache :

# Set header expirations on per-project basis
  location ~* \.(?:ico|css|js|gif|jpe?g|JPG|png|svg|woff)(\?ver=[0-9.]+)?$ {
      root   /home/ytsejam/public/sirtcantalilar.com/public;
           expires 365d;

           tcp_nodelay off; ## Set the OS file cache. 
           open_file_cache max=100 inactive=120s; 
           open_file_cache_valid 45s; 
           open_file_cache_min_uses 2; 
           open_file_cache_errors off;
           add_header Pragma public;
           add_header Cache-Control "public";
           log_not_found off;

                }

but I get with a huge faillist:

FAILED - (No max-age or expires) - http://xslt.alexa.com/site_stats/js/s/a?url=sirtcantalilar.com
FAILED - (No max-age or expires) - http://fonts.googleapis.com/css?family=PT+Sans:regular,italic,bold
FAILED - (No max-age or expires) - http://sirtcantalilar.com/assets/css/fonts/fontawesome-webfont.eot?
FAILED - (No max-age or expires) - http://scontent-b-lga.xx.fbcdn.net/hphotos-frc3/s403x403/988772_225525044282988_738222852_n.jpg
FAILED - (No max-age or expires) - http://sirtcantalilar.com/assets/css/fonts/BebasNeue-webfont.eot?
FAILED - (No max-age or expires) - http://fonts.googleapis.com/css?family=Dosis:400,500,600,700&subset=latin,latin-ext
FAILED - (No max-age or expires) - http://fonts.googleapis.com/css?family=Open+Sans:400,700italic,600italic,700,600,400italic
FAILED - (No max-age or expires) - http://platform.twitter.com/embed/timeline.633fdd7a8cbe780bedb23434c948fe33.default.css
FAILED - (No max-age or expires) - http://sirtcantalilar.com/assets/css/fonts/Entypo.eot?
FAILED - (60 seconds) - http://external.ak.fbcdn.net/safe_image.php?d=AQC0yxqR5PAB_4uM&w=154&h=154&url=http%3A%2F%2Fsirtcantalilar.com%2Fuploads%2Fimg%2Fposts%2Fthumbnails%2F98%2Fthumb-Amsterdam_Light_Festival.jpg&cfs=1.......

how can I optimize my cache rules and why google font apis or twitter cant use browser cache?

ytsejam
  • 3,291
  • 7
  • 39
  • 69

1 Answers1

0

you can't set expires on object that served externally off your domain/server. Why? because webpagetests "talks" to external server rather than your own server.

  • +1 I didn't downvote you, but whoever did might be expecting a fuller solution. For example, does the error mean that Google and Twitter resources are somehow being used incorrectly? If so, is there a solution? If not, is there a workaround for the test? – Chris Culter Jan 18 '14 at 02:32