hey web browsers, obey my stupid headers...oh you won't? well, then.

This commit is contained in:
John Bintz 2012-04-13 09:14:07 -04:00
parent 43d3ce1423
commit 7b3540ff0c
3 changed files with 5 additions and 4 deletions

View File

@ -13,7 +13,8 @@ module Flowerbox
def _call(env)
if sprockets_file = env['PATH_INFO'][%r{/__F__(.*)$}, 1]
result = sprockets.call(env.merge('QUERY_STRING' => 'body=1', 'PATH_INFO' => sprockets_file))
result[1]['Cache-Control'] = 'max-age: 0'
result[1]['Cache-Control'] = 'max-age: 0; must-revalidate; no-store'
result[1].delete('ETag')
result
else

View File

@ -21,7 +21,7 @@ module Flowerbox
def run(sprockets, spec_files, options)
super do
navigate = Proc.new { browser.navigate.to "http://localhost:#{server.port}/" }
navigate = Proc.new { browser.navigate.to "http://localhost:#{server.port}/?#{Time.now.to_f}" }
begin
navigate.call
@ -83,7 +83,7 @@ HTML
end
def template_files
sprockets.files.collect { |file| %{<script type="text/javascript" src="/__F__/#{sprockets.logical_path_for(file)}"></script>} }
sprockets.files.collect { |file| %{<script type="text/javascript" src="/__F__/#{sprockets.logical_path_for(file)}?#{Time.now.to_f}"></script>} }
end
end
end

View File

@ -47,7 +47,7 @@ module Flowerbox
end
def actual_path_for(file)
@sprockets.find_asset(file, :bundle => false).pathname.to_s
@sprockets.find_asset(file.gsub(%r{\?.*$}, ''), :bundle => false).pathname.to_s
end
end
end