Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Set Accept-Encoding header to fetch compressed data

HTML compresses well, don't waste the users bandwidth!
  • Loading branch information...
commit ac7b59888788a641d00c9469b5f2f69deb8b95c2 1 parent e81f20e
@igrigorik igrigorik authored
Showing with 1 addition and 0 deletions.
  1. +1 −0  lib/assets/javascripts/turbolinks.js.coffee
View
1  lib/assets/javascripts/turbolinks.js.coffee
@@ -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'

0 comments on commit ac7b598

Please sign in to comment.
Something went wrong with that request. Please try again.