This file contains hidden or 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
sub vcl_deliver { | |
if (req.url ~ "/fonts/") { | |
set resp.http.Access-Control-Allow-Origin = "*"; | |
set resp.http.Access-Control-Allow-Methods = "GET, OPTIONS"; | |
set resp.http.Access-Control-Allow-Headers = "Origin, Accept, Content-Type, X-Requested-With, X-CSRF-Token"; | |
} | |
} |
This file contains hidden or 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
# I used https://github.com/eliotsykes/rack-zippy to serve gzipped static assets. | |
# By default the rails asset pipeline was not compressing any static svg files, | |
# so I did the following to achive that. | |
# | |
# First create a rake task that will fine and compress svg files. | |
# File: lib/tasks/assets_svg_compress.rake | |
namespace :assets do | |
task :svg_compress => :environment do | |
svg_files = Dir["./public/**/*.svg"] | |
svg_files.each do |file| |