Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
rc-react-native-http-cache
Advanced tools
React Native http cache control for both fetch/XMLHttpRequest and ImageView
$ npm install rc-react-native-http-cache --save
rc-react-native-http-cache
library from your node_modules/rc-react-native-http-cache/ios
folder like its
described here.
Don't forget to add it to "Build Phases" of project.android/settings.gradle
include ':RCTHttpCache'
project(':RCTHttpCache').projectDir = new File(rootProject.projectDir, '../node_modules/rc-react-native-http-cache/android')
android/app/build.gradle
in section dependencies
...
dependencies {
...
compile project(':RCTHttpCache') // Add this line only.
}
MainActivity.java
...
import cn.reactnative.httpcache.HttpCachePackage;
// Add this line before public class MainActivity
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
...
mReactInstanceManager = ReactInstanceManager.builder()
.setApplication(getApplication())
.setBundleAssetName("index.android.bundle")
.setJSMainModuleName("index.android")
.addPackage(new MainReactPackage())
.addPackage(new HttpCachePackage()) // Add this line
.setUseDeveloperSupport(BuildConfig.DEBUG)
.setInitialLifecycleState(LifecycleState.RESUMED)
.build();
}
}
-keep class com.facebook.cache.disk.DiskStorageCache {
private boolean maybeUpdateFileCacheSize();
}
import * as CacheManager from 'rc-react-native-http-cache';
// invoke API directly when in need
CacheManager.clear();
Clear cache for all type.
Return a promise which indicate the clear state.
Get cache size for all type.
Return a promise that contain the cache size(in bytes).
Clear cache for fetch/ajax only.
Return a promise which indicate the clear state.
Get cache size for fetch/ajax only.
Return a promise that contain the cache size(in bytes).
Clear cache for ImageView only.
Return a promise which indicate the clear state.
Get cache size for ImageView only.
Return a promise that contain the cache size(in bytes).
FAQs
Control http cache used by fetch/XMLHttpRequest
We found that rc-react-native-http-cache demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.