Created
February 16, 2013 11:26
-
-
Save toolmantim/4966482 to your computer and use it in GitHub Desktop.
Pre-fetching your Rails asset hostname using dns-prefetch in your application's layout file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>App title</title> | |
<% if ActionController::Base.asset_host %> | |
<link rel="dns-prefetch" href="//<%= ActionController::Base.asset_host %>" /> | |
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!!! | |
%html | |
%head | |
%title App title | |
- if ActionController::Base.asset_host | |
%link{rel:"dns-prefetch", href:"//#{ActionController::Base.asset_host}"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment