web_response_cache

Creator: coderz1093

Last updated:

0 purchases

web_response_cache Image
web_response_cache Images

Languages

Categories

Add to Cart

Description:

web response cache

Introduction #
This package is used for caching responses obtained from web requests.
There are no limitations in which representations (such as JSON, HTML, XML, ...) are cached. All major HTTP verbs such as GET, POST, PUT and DELETE are supported.
The cache will be used whenever

the given cache type is still in charge of being used (like when the duration of a time cache has not been reached)
a new request did not respond with a successful result

It is currently planned to extend the package with more cache types as well as more cache-related fields in the future.
Feel free to send ideas and feedback using the GitHub Issue Board.
Example #
Using a simple time cache for a JSON response:
const testUrl = 'http://worldtimeapi.org/api/timezone/Europe/Berlin';
final cachedRequest = CachedWebRequest(url: testUrl, webCacheType: TimeWebCacheType(cacheDuration: const Duration(days: 1)));
var response = await cachedRequest.startRequest();
...

// response body will have the same body content for the duration of one day
response = await cachedRequest.startRequest();
copied to clipboard
Dependencies #

http (used for sending HTTP requests)
path_provider (used for getting the temporary cache directory)

Contributing #
Contributions to the GitHub Repository are very welcomed.
I also appreciate feature requests as well as bug reports using the GitHub Issue Board.

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.