You're tasked with building a PWA for a ticket booking platform. The requirement is to ensure users can view their booked tickets even when offline. How would you implement this functionality?

  • a) Use local storage to store ticket data on the user's device.
  • b) Implement Service Workers: Use them to intercept network requests and cache ticket data.
  • c) Require users to download a PDF of their booked tickets for offline access.
  • d) Use cookies to store ticket data in the user's browser.
To ensure users can view their booked tickets offline in a PWA, the best approach is to implement Service Workers (option b). Service Workers can intercept network requests, cache ticket data, and serve it to users when they are offline. Local storage (option a) is limited in capacity and may not provide a seamless offline experience. Downloading PDFs (option c) is not user-friendly, and cookies (option d) are not suitable for storing large amounts of data offline.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *