GithubHelp home page GithubHelp logo

tudorilisoi / f-etag Goto Github PK

View Code? Open in Web Editor NEW

This project forked from export-mike/f-etag

0.0 2.0 0.0 39 KB

a thin wrapper around fetch api to provide a basic level in memory cache for etags

JavaScript 100.00%

f-etag's Introduction

Build Status

f-etag

A thin wrapper around the fetch API. For a given 200 response with an ETag header we resolve the promise for the current request and clone the response and store it in an in-memory cache. For a 304 response with a matching ETag header we resolve the same response object from the previous 200 response.

Why ETag caching?

They’re a pain to deal with having to check for 304 and deal with the caching strategy yourself, this is not designed to work between refreshes in the browser. This library is aimed towards browser usage. But it’s not setup between browser refreshes? Yes this is a requirement of an existing project but by all means plugin a caching strategy somehow in a PR.

Install

npm install f-etag isomorphic-unfetch

Usage

import 'isomorphic-unfetch'
import eFetch from 'f-etag';

// Use eFetch like the normal fetch API.

f-etag's People

Contributors

export-mike avatar tudorilisoi avatar jaydenseric avatar cfey avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.