3
我已經寫了一個Capistrano配方去除all.js
緩存的JavaScript文件,並告訴服務器重新啓動,但它仍然無法正常工作。不可避免地,我必須手動刪除all.js
文件,然後手動重新啓動Apache。 (觸摸restart.txt並不總是有效)。JavaScript緩存,Rails和Apache乘客?
有人有這個問題的工作解決方案?
這裏是當前配方:
desc "Package Javascripts"
task :package_javascripts, :roles => :web do
sudo %{rm -f #{current_path}/public/javascripts/all.js}
javascripts.each do |javascript|
run %{/usr/bin/ruby #{current_path}/lib/jsmin.rb < \
#{current_path}/public/javascripts/#{javascript}.js >> \
#{current_path}/public/javascripts/all.js}
end
run "touch #{current_path}/tmp/restart.txt"
end