HighPerformanceWebSites

Css typetextcss import allows you to import one style

Info icon This preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Typical HTTP 1.1 response headers might look like this: –  Cache- Control is an alternaOve to Expires –  When cache-control: max-age is present, the response is stale if its current age is greater than the age value given (in seconds) at the Ome of a new request for the resource –  The max- age direcOve on a response implies that the response is cacheable HTTP/1.1 200 OK Date: Fri, 30 Oct 1998 13:19:41 GMT Server: Apache/1.3.3 (Unix) Cache-Control: max-age=3600, must-revalidate Expires: Fri, 30 Oct 1998 14:19:41 GMT Last-Modified: Mon, 29 Jun 1998 02:28:12 GMT ETag: "3e86-410-3596fbbc" Content-Length: 1040 Content-Type: text/html Here is a way to add an Expires header to files using the Apache httpd.conf file; add the lines: <FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css| swf)$"> Header set Expires "Thu, 15 Apr 2010 20:00:00 GMT" </FilesMatch> Copyright 2009 - 2013 Horowitz 15 Rule 4: Gzip Components •  Compression works when a web server like Apache is set up to "compress" resources and when a client’s browser accepts such compressed resources. •  During the iniOal negoOaOon, if both browser and server support at least one "common" compression method (gzip, compress, etc) then the transfer is compressed. • Client: GET / HTTP/1.1! Accept-Encoding: gzip,deflate • Server: HTTP/1.1 200 OK! Vary: Accept-Encoding! Content-Encoding: gzip! •  90% of browsers support compression ! Copyright 2009 - 2013 Horowitz 16 More on Gzip’ing Components •  A couple of Apache modules to enable / modify compression: •  Apache Module mod_deflate: –  hlp://hlpd.apache.org/docs/2.0/mod/mod_deflate.html –  Allows output from the server to be compressed before being sent to the client –  AddOutputFilterByType DEFLATE text/html text/plain text/xml •  Apache Module m...
View Full Document

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern