# Javascript\_include\_tag - release number instead of time stam

**URL:** <https://www.ruby-forum.com/t/javascript-include-tag-release-number-instead-of-time-stam/111675>\
**Category:** Rails\
**Created:** [August 9, 2007, 7:02pm UTC](https://www.ruby-forum.com/t/javascript-include-tag-release-number-instead-of-time-stam/111675 "2007-08-09T19:02:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![helzer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/e19b73/32.png) [@helzer](https://www.ruby-forum.com/u/helzer)\
**Post date:** [August 9, 2007, 7:02pm UTC](https://www.ruby-forum.com/t/javascript-include-tag-release-number-instead-of-time-stam/111675/1 "2007-08-09T19:02:33Z")

</div>

I’ve noticed that the major part of my pages’ load time is the  
Javascript for prototype and effects. Instead of forcing a reload per  
request (by attaching the ?timestamp parameter), I’d like to force  
reload this per release.

Right now, I load the CSS and JS manually (without the Rails helpers)  
and just append a release number manually. It’s OK, but when I forget,  
the CSS / JS don’t update.

Is there any way for the Layout template to access the release number?

Thanks,  
Amir

---

<div class="post-metadata">

**Author:** ![helzer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/e19b73/32.png) [@helzer](https://www.ruby-forum.com/u/helzer)\
**Post date:** [August 9, 2007, 7:21pm UTC](https://www.ruby-forum.com/t/javascript-include-tag-release-number-instead-of-time-stam/111675/2 "2007-08-09T19:21:36Z")

</div>

Hi,

> Javascript for prototype and effects. Instead of forcing a reload per  
> request (by attaching the ?timestamp parameter), I’d like to force  
> reload this per release.

Actually it’s not a per-request reload The timestamp is not the current  
time, but the timestamp of when the file was last updated. By doing  
this, js, images, css… have the same signature (timestamp included) as  
long as you don’t modify them, which is fine.

Your browser should detect the file name is the same and use the cached  
version. No need for anything else.

regards,

javier ramírez

---

<div class="post-metadata">

**Author:** ![helzer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/e19b73/32.png) [@helzer](https://www.ruby-forum.com/u/helzer)\
**Post date:** [August 9, 2007, 7:25pm UTC](https://www.ruby-forum.com/t/javascript-include-tag-release-number-instead-of-time-stam/111675/3 "2007-08-09T19:25:36Z")

</div>

> I’ve noticed that the major part of my pages’ load time is the  
> Javascript for prototype and effects. Instead of forcing a reload per  
> request (by attaching the ?timestamp parameter), I’d like to force  
> reload this per release.
> 
> Right now, I load the CSS and JS manually (without the Rails helpers)  
> and just append a release number manually. It’s OK, but when I forget,  
> the CSS / JS don’t update.
> 
> Is there any way for the Layout template to access the release number?

This might be of use…

[http://agilewebdevelopment.com/plugins/assetpackager](http://agilewebdevelopment.com/plugins/assetpackager)

---

<div class="post-metadata">

**Author:** ![helzer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/e19b73/32.png) [@helzer](https://www.ruby-forum.com/u/helzer)\
**Post date:** [August 9, 2007, 8:06pm UTC](https://www.ruby-forum.com/t/javascript-include-tag-release-number-instead-of-time-stam/111675/4 "2007-08-09T20:06:43Z")

</div>

Thanks a lot Philip,

> [http://agilewebdevelopment.com/plugins/assetpackager](http://agilewebdevelopment.com/plugins/assetpackager)

This came in right on time, just as I was planning to reinvent the  
wheel.

Amir
