How to use Output Cache with Authentication

Поділитися
Вставка
  • Опубліковано 10 лют 2025

КОМЕНТАРІ • 8

  • @jetonpeche
    @jetonpeche Рік тому +1

    oh nice thank you !

  • @Tefery
    @Tefery 3 місяці тому +1

    And now, all the calls to that API are unauthenticated... The cache management it's before authentication, you have to be more carefull of what you do, it something cannot be done by default, ask yourself why...
    EDIT: I just had to add the cache after adding the authentication instead of adding it at the beginning 🤣🤣

    • @spyroskatsios
      @spyroskatsios  3 місяці тому

      What do you mean ' all the calls to that API are unauthenticated' ??

    • @Tefery
      @Tefery 3 місяці тому

      @@spyroskatsios Just the first call to the API are Authenticated, because the cache it's resolved before the authentication, so, meanwhile the call it's cached, the authentication it's bypassed

    • @spyroskatsios
      @spyroskatsios  3 місяці тому

      @@Tefery It's not resolved before the authentication. The Authentication Middleware is before the cache one. Maybe you are looking at the order of the Attributes? If yes, the order of middleware components in the request pipeline is the one that matters.

    • @Tefery
      @Tefery 3 місяці тому

      @@spyroskatsios True, I just had to add the cache after adding the authentication instead of adding it at the beginning 🤣🤣