ming1016 / stmurlcache Goto Github PK
View Code? Open in Web Editor NEWiOS预加载Web页面方案
License: MIT License
iOS预加载Web页面方案
License: MIT License
使用STMURLCache来缓存页面,确实页面的html缓存下来了,离线状态去看也没也有html框架,但是正常有网的情况下去打开,页面没有正确加载出数据,只有html框架显示
我是加载整个webview页面
self.sCache preLoadByWebViewWithUrls:@[ADCALL_URL]];
下面这句话还用写吗
self.sCache = [STMURLCache create:^(STMURLCacheMk *mk) {
}];
我把 [self.sCache preLoadByWebViewWithUrls:@[adURL]];
方法放到- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions这里
有的时候程序会报错
发现有些坑.使用wkwebView,发现post请求参数body丢失问题,查看yeatse/NSURLProtocol-WebKitSupport#7, 说可以跟服务端定个协议,WebP 图片改成类似 webp://xxx.com/xxx 这样的形式,然后注册名为 webp 的 scheme 来拦截,但是这个需求服务端那边可能不太愿意改因为太多了。想问下使用WKwebView有没有更好的方案可以解决预加载出现的问题,更快速可以加载网页显示速度.
NSURLProtocol 方式的话 会把平时的http的get请求缓存吧 是不是不安全呢
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.