Nest.js Caching Tutorial in 15 Minutes (Redis + Unit Testing)

Sdílet
Vložit
  • čas přidán 27. 07. 2024
  • Learn how to implement powerful caching in Nest.js in order to greatly speed up your apps. We also walk through using Redis as a distributed store and unit testing.
    Repo: github.com/mguay22/nestjs-cache
    Docs: docs.nestjs.com/techniques/ca...
    Timestamps
    00:00:00 Project Setup
    00:01:01 Register Cache
    00:02:16 CacheManager
    00:05:17 CacheInterceptor
    00:07:56 Unit Testing
    00:10:20 Redis
    Get my highly-rated Udemy courses at a discount here: michaelguay.dev/udemy/
  • Věda a technologie

Komentáře • 39

  • @mguay
    @mguay  Před 5 měsíci

    Get my highly-rated Udemy courses at a discount here: michaelguay.dev/udemy/

  • @AliAliOxenFree
    @AliAliOxenFree Před rokem +13

    Ok first off, it is clear you’ve mastered nestjs. Second of all, this is an excellent explanation. I will have to watch this short video several times to absorb the info youve dished out. Keep it up man you’ve earned yourself a happy subscriber

  • @kareemlateefyomi8690
    @kareemlateefyomi8690 Před měsícem

    Every Nestjs developer should watch this 😊. Thanks Micheal

  • @aminemohy2064
    @aminemohy2064 Před 2 lety +1

    after days of searching online , you made me get how cache/redis work in 15min
    thank you so much
    keep making videos like this
    cheers

  • @Herzenn
    @Herzenn Před 2 lety +1

    Thank you so much, Michael. I couldn't find how to properly mock the cache manager anywhere else. Keep up the good work.

  • @williamx0
    @williamx0 Před 2 lety +1

    Wooh! Great as always. Thanks Michael!

  • @willl0014
    @willl0014 Před rokem +1

    I am building a new product with nestjs and your videos are gold!

  • @behnoudmst
    @behnoudmst Před 10 měsíci

    Perfect video, short and to the point. Thanks❤

  • @AbdurrahmanHafez
    @AbdurrahmanHafez Před 2 lety

    Great tutorial
    I am waiting more videos from you 🚀
    Thank you so much

  • @giftjeremiah3312
    @giftjeremiah3312 Před 10 měsíci +1

    Excellent tutorial. Really clear and precise explanation. Keep up the good work ❤

  • @alexeylysenko7380
    @alexeylysenko7380 Před 2 lety

    Top material! Thank you!

  • @user-ym9fp2je8u
    @user-ym9fp2je8u Před 2 lety

    You are the best 👍
    Please, more cool videos!

  • @whoknows3679
    @whoknows3679 Před 2 lety

    Great video!

  • @lilililliilil
    @lilililliilil Před rokem

    Great video! Man u should create more videos using Nest and Observable like realtime username validation stuff😊

  • @user-ql6md1eh4h
    @user-ql6md1eh4h Před 8 měsíci

    Good job. Thanks a lot.

  • @IndraPrasetya154
    @IndraPrasetya154 Před rokem

    Greate video, thank you so much

  • @dawid_dahl
    @dawid_dahl Před rokem

    Thank you so much!

  • @shahariarkabir210
    @shahariarkabir210 Před rokem

    Man you are super awesome. 😒💪

  • @AntonGorbachevDev
    @AntonGorbachevDev Před 2 lety

    Thx for great video!

    • @mguay
      @mguay  Před 2 lety +1

      Glad you liked it!

  • @DjMaSaKre
    @DjMaSaKre Před rokem +1

    Great tutorial! Tnx man!
    For those who are struggling with cache not working try to downgrade cache-manager pkg to version 4.1.0, current 5.X version is not compatible with NestJS 8.

  • @EstebanHelgueroCardiff

    Hi! Great tutorial! If you are going to use cache for a big app, in which cases would you use It? Would you use Redis or another store system? Thanks

  • @justinnoor4915
    @justinnoor4915 Před 2 lety

    Thank you for this video. How do we determine if the Redis cache should be implemented with cache-manager or with a microservice?

  • @michaelyao9389
    @michaelyao9389 Před 2 lety

    Hi @Michael Guay, Do "Auto-caching responses" and "redis store" work together? I tried, somehow, it did not use the redis as the store still?

  • @ndaraaa
    @ndaraaa Před 2 lety

    Great tutorial. Can u do a monitoring and logging NestJS app 😁

  • @andresfcuellarc
    @andresfcuellarc Před rokem

    Genial Thanks

  • @oleksiishkulipa1626
    @oleksiishkulipa1626 Před rokem

    can you please help ? how much can i cached data by this method ? and where will those data be placing ?
    And what about Redis, which method will be better use for caching between cacheManager and Redis ?
    Thx

  • @asakurayoh3909
    @asakurayoh3909 Před rokem

    Does TTL also gets saved as part of Redis? I mean if we restart the server, does the TTL reset or no?

  • @dendytbm3113
    @dendytbm3113 Před rokem

    how to make a 'unit test' of a controller implementing cacheInterceptor?

  • @caiman1110
    @caiman1110 Před 2 lety

    Do you have samples of nest js with @google-cloud/storage?

  • @superpupernone
    @superpupernone Před 2 lety +1

    Great tutorial. Thank you.
    And how to cache GraphQL requests?

    • @mguay
      @mguay  Před 2 lety +1

      GraphQL isn't supported by the interceptor, so we'll have to cache ourselves using the CacheManager.

    • @superpupernone
      @superpupernone Před 2 lety +1

      @@mguay do you have tutorial about that? (-:

  • @huynhthiailinh
    @huynhthiailinh Před rokem

    how to config key prefix?

  • @ashishkumari-yg4gn
    @ashishkumari-yg4gn Před rokem

    I getting an error at option - store :redisStore
    Type 'typeof import("C:/sample/complete-rest-api/node_modules/cache-manager-redis-store/dist/index")' is not assignable to type '(string | CacheStoreFactory | CacheStore)