Coder Social home page Coder Social logo

redis-driver's People

Contributors

bloodf avatar fifciu avatar filipsobol avatar lsliwaradioluz avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

redis-driver's Issues

[Feature]: prevent duplicate page cached

How the project can be improved?

Actually we are caching all the params url. But it's not good

  • The node server will take a huge amount of load with the rendering of these pages.
  • Redis store all of theses unnecessary pages.
  • The user can experience multiple delays to see a page.

Imagine a common use case with redirection from partners annonce with an ID in the used by Google Tag Manager for example ( Client side usage ).
We are duplicating all of theses urls in the redis storage.
Capture d’écran 2022-02-21 à 12 00 22

One solution would be to add an allowParamsUrl in the config.

{ 
  allowParamsUrl: ['q', 'prices', 'colors', .... ]
}

With that even with a random param in the url we will render the same cached page.

What are the acceptance criteria?

  • [ ]

Additional information

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

[Bug]: Authenticated/Not authenticated user state cached on every page

Expected Behavior

In the header of storefront ui theme there is user icon which has autenticated/not authenticated states.

If the page was cached when user was not authenticated you will always see not authenticated state on first load or vice versa

Actual Behavior

Cached pages should ignore user state and show current state of user state and not cached one.

Possible Solution

No response

Steps to reproduce

  1. Enable REDIS cache
  2. Visit homepage (user not authenticated)
  3. Authenticate user via login/register form
  4. In the header you can see that user is authenticated (user authenticated)
  5. Reload page
  6. You will see that header shows cached user state (user not authenticated)

What version of Magento 2 integration are you using?

Custom integration

What version of Node.js are you using?

16.13.1

What browser (and version) are you using?

Edge

What operating system (and version) are you using?

macOS

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

[Bug]: error page are cached

Expected Behavior

We should not cache any error pages ( 404, 500... )

Actual Behavior

Actually even if the rendering contains an error, the page are put in cache.

const content = await render();
const tags = getTags();

if (!tags.length) {
  return content;
}
------> We should check if there is an error in `content`<-----
// We could add "await" here, but saving content in cache doesn't have to block the request
client.set(
  key,
  content,
  tags
);

Possible Solution

Add a check for content.error variable and do not cache the response.

Steps to reproduce

Hit a 404 page.

What version of Magento 2 integration are you using?

2.4.3

What version of Node.js are you using?

16

What browser (and version) are you using?

Chrome

What operating system (and version) are you using?

macOS

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

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.