LoginSignup
1
1

More than 5 years have passed since last update.

指定のjsファイルにfingerprintsを付ける方法

Last updated at Posted at 2014-01-23

http://it.sifr.me/ruby-on-rails-asset-pipeline/
を見ると詳しく載っている。
fingerprintsとはJSのキャッシュをうまく利用する為の
一意性を確保する為の仕組み。よく「?20120101」とかJSファイル読み込みの末尾に付けるようなもの。

production.rbに下記でtest.jsにfingerprintsがつく。
config.assets.precompile += %w( test.js )

scriptタグはこんな感じになるはず

<script src="/assets/test-907fdc4e5e9e00d0f032e2feef246f6b.js"></script>
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1