# Problem with javascript\_include\_tag with :cache

**URL:** <https://www.ruby-forum.com/t/problem-with-javascript-include-tag-with-cache/128803>\
**Category:** Rails\
**Created:** [February 11, 2008, 6:12pm UTC](https://www.ruby-forum.com/t/problem-with-javascript-include-tag-with-cache/128803 "2008-02-11T18:12:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tnitsche](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/958977/32.png) [@tnitsche](https://www.ruby-forum.com/u/tnitsche)\
**Post date:** [February 11, 2008, 6:12pm UTC](https://www.ruby-forum.com/t/problem-with-javascript-include-tag-with-cache/128803/1 "2008-02-11T18:12:37Z")

</div>

Hi,

I’m using the Rails 2 feature for asset packing, but I still can’t  
figure out how Rails decides when to expire a cached asset package. I’m  
using

\<%= javascript\_include\_tag “prototype”, “application”, “effects”,  
“my\_stuff”  
:cache =\> “cache/site” %\>

in my template, which becomes a

in the HTML. If I now update my\_stuff.js, the only way to get the  
changes “online” so far was deleting the cache/site.js and restart the  
server - which is obviously a little bit rough. I tried to touch every  
.js in my javascript dir, I touched the  
corresponding RHTML template, no effect. I removed cache/site.js, but  
then I get a "No route matches “/javascripts/cache/defaults.js” (which  
is fairly understandable on the other hand).

Any idea what’s best practice here?

Cheers

Thomas

---

<div class="post-metadata">

**Author:** ![tnitsche](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/958977/32.png) [@tnitsche](https://www.ruby-forum.com/u/tnitsche)\
**Post date:** [August 10, 2009, 3:04pm UTC](https://www.ruby-forum.com/t/problem-with-javascript-include-tag-with-cache/128803/2 "2009-08-10T15:04:36Z")

</div>

bump !

---

<div class="post-metadata">

**Author:** ![tnitsche](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/958977/32.png) [@tnitsche](https://www.ruby-forum.com/u/tnitsche)\
**Post date:** [December 4, 2009, 12:19am UTC](https://www.ruby-forum.com/t/problem-with-javascript-include-tag-with-cache/128803/3 "2009-12-04T00:19:00Z")

</div>

bump!

---

<div class="post-metadata">

**Author:** ![tnitsche](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/958977/32.png) [@tnitsche](https://www.ruby-forum.com/u/tnitsche)\
**Post date:** [December 4, 2009, 8:19pm UTC](https://www.ruby-forum.com/t/problem-with-javascript-include-tag-with-cache/128803/4 "2009-12-04T20:19:35Z")

</div>

Found the solution here: [http://bit.ly/5nkfNs](http://bit.ly/5nkfNs)
