-
Notifications
You must be signed in to change notification settings - Fork 292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
缓存成功一段时间后不再从缓存获取静态资源了 #172
Comments
是不是给url加参数了? |
@yale8848 对的,访问的入口url是有加参数的。怎么处理呢?谢谢 |
CacheWebView目前只缓存静态资源,所以对静态资源的url必须锁定,不能改变,如果改变的话就缓存失效了。目前本库不能解决这个问题 |
也就是说,过了一段时间我的入口URL参数变了,导致其他已经缓存的js. css之类的全失效了,对吗?我这边只是入口URL变了,加载js css那些请求URL是没有变化的哦。
|
Repository owner
deleted a comment
Feb 2, 2024
Repository owner
deleted a comment from
huzhen-v5
Mar 4, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Mobile: 华为 mate30 Pro
Android OS: 10 NetWork: WiFI/4G/5G
URL: 不便透露
LIB Version: ren.yale.android:cachewebviewlib:2.1.8
---
前端所需的静态文件js、css等都已经缓存成功了,再次启动APP,后台也打印了from cache。 但过了一晚,再次调试发现js、css等又变成from service了(连续多日问题都存在) 确定后台前端资源未做修改。
调试发现在WebResourceResponseAdapter中的下面方法
public Map<String, String> getResponseHeaders() {
return mWebResourceResponse.getResponseHeaders();
}
打印了responseHeaders中的cache-control=max-age=3153600000
说明应该是长期缓存的才对,为什么会过了一段时间就没了缓存呢(在iOS上也有采用缓存策略,但似乎并没有这个问题),是什么原因呢?
The text was updated successfully, but these errors were encountered: