Giter Site home page Giter Site logo

Comments (1)

pturley avatar pturley commented on August 20, 2024

Well, there are a few things that we could do instead of the singleton object to basically share state between requests without hitting the database. The honest truth is that none of them are without problems:

  1. Caching the calls in class variables inside a service class. This one's big problem is that those class variables wont be shared across processes or threads. Sometimes it makes for an inconsistent experience for users.
  2. Storing the result of the calls in something like memcache (or the database for that matter). This seems like a bit of a tough given the fact that we move to being a gem. Tough to request that people put in a cache solution to use our gem.
  3. Store the entire html in the database and just use the database to be our caching solution completely and that itself prevents us from making the service calls.
  4. Same story but with the filesystem, but if we roll this thing out to multiple servers, that wouldnt be a good idea.

from dashtag.

Related Issues (20)

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.