Skip to content
This repository has been archived by the owner on Jul 28, 2018. It is now read-only.

Commit

Permalink
Set Accept-Encoding header to fetch compressed data
Browse files Browse the repository at this point in the history
HTML compresses well, don't waste the users bandwidth!
  • Loading branch information
igrigorik committed Sep 29, 2012
1 parent e81f20e commit ac7b598
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/assets/javascripts/turbolinks.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ fetchReplacement = (url) ->
xhr = new XMLHttpRequest
xhr.open 'GET', url, true
xhr.setRequestHeader 'Accept', 'text/html, application/xhtml+xml, application/xml'
xhr.setRequestHeader 'Accept-Encoding', 'gzip, deflate'
xhr.onload = ->
changePage extractTitleAndBody(xhr.responseText)...
triggerEvent 'page:load'
Expand Down

0 comments on commit ac7b598

Please sign in to comment.