SlideShare uma empresa Scribd logo
1 de 15
Shooing away the offline dinosaur
from your legacy site
Aapo Kiiso
Lamia is a digital
engineering partner that
specializes in ecommerce
+4 MEUR
Lamia’s
Turnover
2012
Lamia was
established
40
Digital Commerce
Experts
+100%
2017
Growth
When you just have to make offline happen
for a pre-PWA era website
3 main ingredients for
this hands-off offline strategy
1. Puppeteer
2. Service Worker
3. API for managing cache
Setting up caching
Demo
Puppeteer is the new king
of web scraping
Logging responses on a page
with Puppeteer
Saving a response’s body
to disk
Scraping with Puppeteer
Demo
Offline pre-cache is network-first
Ryan Chenkie / auth0.com
Offline pre-caching is not
a page load issue
First visit (Desktop)
Subsequent visit (Desktop)
Unpacking the archive
in the Service Worker
Shout-out to
Persisting archived responses
on the client
Setting up Service Worker
Demo
Thank you!

Mais conteúdo relacionado

Semelhante a Shooing away the offline dinosaur from your legacy site

Pg. 03Question Three Assignment 3Deadline Sunda.docx
Pg. 03Question Three Assignment 3Deadline Sunda.docxPg. 03Question Three Assignment 3Deadline Sunda.docx
Pg. 03Question Three Assignment 3Deadline Sunda.docx
JUST36
 
Pg. 03Question Three Assignment 3Deadline Sunda.docx
Pg. 03Question Three Assignment 3Deadline Sunda.docxPg. 03Question Three Assignment 3Deadline Sunda.docx
Pg. 03Question Three Assignment 3Deadline Sunda.docx
karlhennesey
 

Semelhante a Shooing away the offline dinosaur from your legacy site (20)

Miracle Inameti-Archibong - Are Progressive Web Apps The Future Of The Web?
Miracle Inameti-Archibong -  Are Progressive Web Apps The Future Of The Web?Miracle Inameti-Archibong -  Are Progressive Web Apps The Future Of The Web?
Miracle Inameti-Archibong - Are Progressive Web Apps The Future Of The Web?
 
Getting Started with SharePoint 2013 Apps
Getting Started with SharePoint 2013 AppsGetting Started with SharePoint 2013 Apps
Getting Started with SharePoint 2013 Apps
 
RPA in a Day
RPA in a Day RPA in a Day
RPA in a Day
 
Jeremy Thake Perth Share Point Ug Sp2010 How Will Be Affect Me
Jeremy Thake  Perth Share Point Ug   Sp2010 How Will Be Affect MeJeremy Thake  Perth Share Point Ug   Sp2010 How Will Be Affect Me
Jeremy Thake Perth Share Point Ug Sp2010 How Will Be Affect Me
 
Whats new in SharePoint Online
Whats new in SharePoint OnlineWhats new in SharePoint Online
Whats new in SharePoint Online
 
CloudShare Dev and Test SPSTCDC
CloudShare Dev and Test SPSTCDCCloudShare Dev and Test SPSTCDC
CloudShare Dev and Test SPSTCDC
 
Planning Very Large Scale Document Repositories with High Availability in Sha...
Planning Very Large Scale Document Repositories with High Availability in Sha...Planning Very Large Scale Document Repositories with High Availability in Sha...
Planning Very Large Scale Document Repositories with High Availability in Sha...
 
Planning very large scale document repositories with high availability in sha...
Planning very large scale document repositories with high availability in sha...Planning very large scale document repositories with high availability in sha...
Planning very large scale document repositories with high availability in sha...
 
Akamai Developer General Session
Akamai Developer General SessionAkamai Developer General Session
Akamai Developer General Session
 
Are PWAs The Future of the Web?
Are PWAs The Future of the Web?Are PWAs The Future of the Web?
Are PWAs The Future of the Web?
 
RTO < 15min for 1TB Oracle DB - Actifio replaces Oracle Data Guard
RTO < 15min for 1TB Oracle DB - Actifio replaces Oracle Data GuardRTO < 15min for 1TB Oracle DB - Actifio replaces Oracle Data Guard
RTO < 15min for 1TB Oracle DB - Actifio replaces Oracle Data Guard
 
Cloud computing
Cloud computingCloud computing
Cloud computing
 
ECS19 - Serge Luca - MICROSOFT FLOW IN REAL WORLD PROJECTS: 3 YEARS LATER AN...
ECS19 - Serge Luca -  MICROSOFT FLOW IN REAL WORLD PROJECTS: 3 YEARS LATER AN...ECS19 - Serge Luca -  MICROSOFT FLOW IN REAL WORLD PROJECTS: 3 YEARS LATER AN...
ECS19 - Serge Luca - MICROSOFT FLOW IN REAL WORLD PROJECTS: 3 YEARS LATER AN...
 
HTML 5 Offline Web apps
HTML 5 Offline Web apps HTML 5 Offline Web apps
HTML 5 Offline Web apps
 
Startups without Servers
Startups without ServersStartups without Servers
Startups without Servers
 
Remote Workers Webinar (Episode 2)
Remote Workers Webinar (Episode 2)Remote Workers Webinar (Episode 2)
Remote Workers Webinar (Episode 2)
 
Pg. 03Question Three Assignment 3Deadline Sunda.docx
Pg. 03Question Three Assignment 3Deadline Sunda.docxPg. 03Question Three Assignment 3Deadline Sunda.docx
Pg. 03Question Three Assignment 3Deadline Sunda.docx
 
Pg. 03Question Three Assignment 3Deadline Sunda.docx
Pg. 03Question Three Assignment 3Deadline Sunda.docxPg. 03Question Three Assignment 3Deadline Sunda.docx
Pg. 03Question Three Assignment 3Deadline Sunda.docx
 
Armada Preso
Armada PresoArmada Preso
Armada Preso
 
Scaling Slack - The Good, the Unexpected, and the Road Ahead
Scaling Slack - The Good, the Unexpected, and the Road AheadScaling Slack - The Good, the Unexpected, and the Road Ahead
Scaling Slack - The Good, the Unexpected, and the Road Ahead
 

Último

Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
Epec Engineered Technologies
 
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
dharasingh5698
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Kandungan 087776558899
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ssuser89054b
 

Último (20)

Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086
 
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
 
Unit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdfUnit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdf
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
 

Shooing away the offline dinosaur from your legacy site

Notas do Editor

  1. How to provide an offline experience for a legacy site, such as Wordpress or other CMS with hard-coded templates Totally custom site with scary codebase
  2. Lamia: Digital Commerce company located in Kamppi Around 40 people Ranking 4th in Deloitte’s Tech Fast 50 listing in 2017 Specialized in open source tech and Google Cloud infrastructure (BigQuery) Design, integrations and UI implementations for various projects, mainly ecommerce I myself am working as a full-stack (frontend-focus) dev, currently on a Magento 2 project
  3. Want new web features, legacy codebases hinders Avoid playing Chrome dinosaur game, provide a real offline fallback (customers using to show catalog products) Point: New tech rising, old tech dying, we still want nice things on old platforms
  4. Demo: Set up API at aapo.kii.so Go to https://aapo.kii.so Open Dev Tools Show that there are no SWs installed Show that the site doesn’t have offline support by going offline Show on site which pages you want to cache Open Postman Run “Adding a client resource” for “https://aapo.kii.so/offline.html”, “https://aapo.kii.so/” and “https://aapo.kii.so/retu.html” with the client ID 030118b2-74f0-4b4d-8e2b-9fcc2640e66e
  5. Puppeteer is a browser scripting tool. It’s a JS library wrapping around headless Chrome, can be used in Node.js Was released last summer, has overtaken Webkit-based PhantomJS, Electron (chromium) based Nightmare as the most popular browser scripting tool In addition to caching page responses, you can use it to: Generate PDF screenshots of pages Automate UI testing (form inputs, UX paths) Diagnose perf issues (it uses Chromium DevTools protocol to control pages, you can use those tools too)
  6. Demo: Scraping an archive Login to the server with “ssh aapo.kii.so” In the pwa-precache dir, run “node scrape” Run “node scrape” again to demonstrate it won’t mindlessly create new archives Show index.json contents by running “tar xf archive” and “vim index.json”
  7. Request leaves application Goes to SW which sits as a sort of proxy between the client and the network If there is no connectivity, it will try to find a response with a matching resource from the offline pre-cache Point is: Precache is not used at all if network is available, it is optimized & only intended for offline use.
  8. Graphs: Not much additional CPU usage from pre-cache download & untar Very small bump can be seen on the initial page load after the main page load bump Pre-cache in our demo case fits well into quota, but we don’t have a lot in the cache
  9. 2: arrayBuffer native method of fetch response 3: Show untar utility: https://github.com/InvokIT/js-untar 3: Gzip handled by browser 7: “readAsJSON” is a method of untar result object 15: Replace md5’d file name with response URL
  10. Uncomment registration in index.html Go to https://aapo.kii.so Check that the SW installed in dev tools Go offline and demo
  11. We are hiring! See our website for roles including cloud engineers devs working on microservices senior frontend guys!