I wrote a Capistrano recipe to delete a cached JavaScript file all.jsand told the server to restart, but it still does not work correctly. And inevitably, I have to manually delete the file all.js, and then manually restart Apache. (touching restart.txt does not always work).
Does anyone have a working solution to this problem?
Here is the current recipe:
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
source
share