How to Cache API Responses with Ionic & Capacitor

Поделиться
HTML-код
  • Опубликовано: 26 янв 2025

Комментарии • 34

  • @behicsakar
    @behicsakar Год назад

    bro thats mindblowing tut. full of observables subscribers and first time i see the browser 20min later you start to type and type and type…

  • @HurikaneTv
    @HurikaneTv 3 года назад

    Proud Academy Member 😊😊😊😊

  • @kareemadel1649
    @kareemadel1649 2 года назад

    can i do that with ionic-cordova app ??

  • @SmartiePantsShop
    @SmartiePantsShop 3 года назад +3

    Hi Simon, thanks for this, it was very very handy. But a quick question, between your examples over the last years, you've swapped between Capacitor Storage and Angular Storage and SQLite - is there a reason as to why I should use one over the other, are there any performance benefits or pitfalls I should be aware of. Thanks for the many many helpful videos.

    • @galaxies_dev
      @galaxies_dev  3 года назад +2

      Either you have a virus on my Mac or I can predict the future - working on a video EXACTLY on that to clarify which to use in which situation!

  • @KrelfallahHichem
    @KrelfallahHichem 3 года назад +1

    Excellent video, thank you

  • @RahulKumar-dm5zy
    @RahulKumar-dm5zy 3 года назад +1

    awesome video sir. thanks for making this video

  • @Marshall86MT
    @Marshall86MT 3 года назад +1

    very interesting video, as usual :) I use capacitor storage instead of the cordova plugin, what do you think?

    • @galaxies_dev
      @galaxies_dev  3 года назад +3

      Sure would work as well, but I found managing it a bit more complicated then directly working with JSON data in Ionic Storage.

    • @Marshall86MT
      @Marshall86MT 3 года назад +2

      @@galaxies_devIt's an honour to get your feedback 🙏🏾 yeah that's true but since I moved to capacitor I'm trying to use it as much as possible.

  • @farbod6450
    @farbod6450 3 года назад

    This video is very helpful. Thank you

  • @cortesdepodcast8254
    @cortesdepodcast8254 3 года назад +2

    Would be nice to compare capacitor 3 with cordova to know which one is faster, smaller and have less bugs.

    • @graphicsjay
      @graphicsjay 3 года назад

      Anyone that's worked with Capacitor after working with Cordova knows its a much better experience. Every time i would open a cordova project (pre-Capacitor), I would have multiple issues to resolve before I could actually get to work. Capacitor hasn't been that way at all.

  • @flyclaim
    @flyclaim 3 года назад

    Does it also work for capacitor android applications or just the web ones? I tried several variants in the android app and it doesn't seem to work and the cause is that it is served on HTTP instead of HTTPS

  • @faqruddinmohammad1411
    @faqruddinmohammad1411 2 года назад

    Hi Simon,
    Nice informative content. But how Can I update the cache storage if api is having updated data ? Having offline storage great for app to improve performance. But in realtime api data always have changes. So once there is changes in api data, Is any way to update the offline cached data ? So user can see always real data...
    Thank you

    • @galaxies_dev
      @galaxies_dev  2 года назад +1

      You would have to come up with your own logic to handle the validation of your cache, so maybe expire it after some time or otherwise use a service worker with a specific caching strategy!

    • @faqruddinmohammad1411
      @faqruddinmohammad1411 2 года назад

      @@galaxies_dev thanks simon. Can I have any example for service worker ?

  • @EvTIC
    @EvTIC Год назад

    sorry i am using ionic react capacitor, api php and phpmyadmin. nothing appear in my phpmyadmin

  • @IRFANSYOUTUBE
    @IRFANSYOUTUBE 3 года назад

    Hi, Working on Ionic Ecommerce Project, Looking for IONIC templates free/paid to sppedup the work. Please help

  • @NoNdAs90
    @NoNdAs90 3 года назад

    What's the difference to do all that to localStorage instead to that that you show ? Thank you for the video :)

    • @galaxies_dev
      @galaxies_dev  3 года назад +2

      On a device, it will use SQLite because that data won't be cleared by the OS, which can happen if you simply store it inside localstorage.

    • @NoNdAs90
      @NoNdAs90 3 года назад

      @@galaxies_dev could you explain it more because I do not the the point exactly? Thank you again for your answer 😁

  • @vincenzodamico3054
    @vincenzodamico3054 3 года назад +2

    💙💙💙💙 CACHIIIIIINNNN!!! 💙💙💙💙

  • @iescape3372
    @iescape3372 3 года назад

    Someone should make a channel like this, but for Vue & React. Having to watch these angular based tutorials, which by the way are great, is painful as I then have to figure out how to convert it to my preferred front end framework

    • @galaxies_dev
      @galaxies_dev  3 года назад +2

      I totally agree. If I had started with all of this about a year ago, I'd have made it 100% about Vue or React as there's basically no content out there yet. But since almost all followers in here are interested in Angular, it's not really a good idea for me right now to create Vue/React content although I'd love to :/

    • @chizuru1999
      @chizuru1999 2 года назад

      @@galaxies_dev do what you feel like. ☺️ Tho i would watch more angular for sure! 👍🏻

  • @DavideCampello
    @DavideCampello 3 года назад +1

    the problems come when you need to create, update or delete the data

    • @victorm9131
      @victorm9131 3 года назад +2

      Well in this case don’t use cache on those APIs. Caching mechanism makes sense for data that isn’t likely to be changed in a while like dictionaries / objects that have the same shape etc.

  • @TheSaceone
    @TheSaceone 3 года назад +1

    Favourite day = Tuesday. No wonder why.

  • @user-ms13w
    @user-ms13w 3 года назад

    dinamics or statics .....
    caches.match( '/offline.html') 👍

    • @user-ms13w
      @user-ms13w 3 года назад

      ruclips.net/video/ifroMW_F4Sc/видео.html 👈

  • @jhonyxf
    @jhonyxf 3 года назад

    how to solve this error?
    ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'addListener' of undefined
    TypeError: Cannot read property 'addListener' of undefined
    at new ApiService (api.service.ts:18)