点击cls*="back"的按钮时,加上是否ignoreCache的判断;同时添加ignoreCache全局配置项,用于全局加载页面的缓存控制 #625
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
场景
新的需求希望在从后一个页面返回到前一个页面的时候不使用缓存,而当前路由提供的方式是只要带有back的class,则默认调用pop来读取前一个页面的cache,不能从服务端拉取。
修改前
修改后
同时新增以下配置项:
使用方法
<a class="back" data-no-cache="true"></a>
不论是否带有
class="back"
,只要带有[data-no-cache="true"]
的超链接都会忽略缓存而重新从服务端获取页面。$.config = {allForward: true, allBack: true}
来进行全局禁用缓存处理。