I have a few JavaScript that I would like to cache as follow :
layout1.erb has
.........
<%= javascript_include_tag 'jquery.min' ,
'rails_ujs',
'qwerty',
'jquery_editinplace',
'jquery.livequery',
'jquery.validate',
'ddsmoothmenu',
:cache=>"main_js_cache"
%>
..........
layout2.erb
.........
<%= javascript_include_tag 'jquery.min' ,
'rails_ujs',
'qwerty',
'jquery_editinplace',
'jquery.livequery',
'jquery.validate',
'ddsmoothmenu',
:cache=>"main_js_cache"
%>
..........
Now since the cache file name is same would the same be used or will it be generated again & again ?
I found the answer..
Left the question open incase others find it useful..
This is how caching goes..
First time suppose you render
layout2.erb.. then it combines and generates a file called as"main_js_cache".Next time you again render
layout2.erbthen it will just directly throw"main_js_cache"without regenerating it.Suppose you render
layout1.ebrin that case rails just looks for a file called"main_js_cache"it finds it and so it does NOT generate a new file.