3

The situation:

  • Application deployed and in use.

  • JavaScript / jQuery (in .js file) updates made.

  • Application redeployed

  • User does not see JavaScript changes unless they clear their cache.

This is presenting non-trivial issues.

Is there a way to have the cache cleared:

  1. Automatically and
  2. Just on the first load (cache as normal after that) when a new deployment is rolled out?
4

2 回答 2

1

使用jawr,这将根据更改为每个文件创建哈希(如果文件未更改,则不会为该文件创建新哈希) https://jawr.java.net/

于 2013-05-11T14:36:42.660 回答
0

您可以在文件名中添加一个参数。比如:path/to/styles.css?deployed=20130424 和 path/to/scripts.js?deployed=20130424

于 2013-04-24T13:40:22.550 回答