Giter Site home page Giter Site logo

Tags do not show. about hamiltoss HOT 1 OPEN

jasonflorentino avatar jasonflorentino commented on June 2, 2024 1
Tags do not show.

from hamiltoss.

Comments (1)

jasonflorentino avatar jasonflorentino commented on June 2, 2024

Thanks for pointing this out Henry! It's actually a quirk of the current implementation: I have to make a second request for that info and wanted to be reeeally nice to that API and only fetch them one at a time. To minimize refetching (and build up the list as the user browses more results) I cache already-fetched "disposal headers" in memory. But since this is currently deployed on a serverless environment, and without any persistent storage, we lose that cache when the host expires the app instances.

if (results.length) {
// Decorate results with their `disposal_header`:
// First check if we have the disposal_header already cached in memory.
// If not, request ONE of them to add on, and store it in cache.
// This lets us be nice and avoid making a spike of requests their api
// in the case we have a long list of search results.
// Make sure to get/set the IDs as strings in the cache Map!
// (We'll also be populating this as clients hit individual pages)
results = [

It felt like a reasonable trade off at the time: The top hit will have its Disposal Header already visible, but results with lower scores will still just be one click away. And if the user comes back to the search page (presumably because they are still searching for the right info), further "previews" of the Disposal Headers will now also be available.

I'll leave this open for now as it does feel off from what someone might expect, but a fix may not come around until one of the things above changes. For instance my willingness to hit an API that I may or may not be supposed to be hitting. πŸ˜†

Hope you're well!
β€”Jason

from hamiltoss.

Related Issues (1)

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.