SlideShare uma empresa Scribd logo
1 de 9
Making web site
available in offline
      mode

         @MehdiKhalili
      www.mehdi-Khalili.com
That is two fold:




1. Use offline cache to get the browser
   to cache your website
2. Use client-side storage to let users
   change data in offline mode
Offline cache (AKA AppCache)

• Communicated through a manifest “file”:
   • set in the html tag’s manifest attribute
   • extension should be ‘appcache’
   • mime type should be ‘text/cache-manifest’
• The manifest does not have to be static
Some tips on AppCache

• AppCache does NOT expire: so somehow version your manifest
• Checkout out your cache entries on chrome://appcache-internals/
Client side storage

Web Storage               Indexed Database

• Great browser support   • Relatively good browser support
• Poor performance        • Great performance
• Simple to use           • Rather complex API
• A good choice ATM       • All in all a good choice
Web SQL - Deprecated!!

• Good browser support (except IE and FF)
• Good performance
• Transactional
• Familiar SQL
• Perhaps not such a great choice
Some tips on offline persistence

• Store user changes in client storage in offline mode
• Sync up as soon as you go online to avoid data loss
• navigator.isOnline is broken. Don’t use it
   • Don’t use AJAX to check connectivity
   • Use AppCache events
much more information on my blog



http://www.mehdi-khalili.com/presentations/wdyk-offline-web




                      @MehdiKhalili

Mais conteúdo relacionado

Destaque

Application Lifecycle Management with TFS
Application Lifecycle Management with TFSApplication Lifecycle Management with TFS
Application Lifecycle Management with TFS
Mehdi Khalili
 

Destaque (19)

Microservices: lessons from the trenches
Microservices: lessons from the trenchesMicroservices: lessons from the trenches
Microservices: lessons from the trenches
 
Cross platform dotnet development using dotnet core
Cross platform dotnet development using dotnet coreCross platform dotnet development using dotnet core
Cross platform dotnet development using dotnet core
 
Cobertura
CoberturaCobertura
Cobertura
 
Getting Started .NET Core
Getting Started .NET CoreGetting Started .NET Core
Getting Started .NET Core
 
Powershell For Developers
Powershell For DevelopersPowershell For Developers
Powershell For Developers
 
Automated UI testing done right (DDDSydney)
Automated UI testing done right (DDDSydney)Automated UI testing done right (DDDSydney)
Automated UI testing done right (DDDSydney)
 
Docker for .NET Developers
Docker for .NET DevelopersDocker for .NET Developers
Docker for .NET Developers
 
Introduction to HTTP/2
Introduction to HTTP/2Introduction to HTTP/2
Introduction to HTTP/2
 
Debugging the Web with Fiddler
Debugging the Web with FiddlerDebugging the Web with Fiddler
Debugging the Web with Fiddler
 
Next .NET and C#
Next .NET and C#Next .NET and C#
Next .NET and C#
 
Lessons from running potentially malicious code inside containers
Lessons from running potentially malicious code inside containersLessons from running potentially malicious code inside containers
Lessons from running potentially malicious code inside containers
 
The How and Why of Windows containers
The How and Why of Windows containersThe How and Why of Windows containers
The How and Why of Windows containers
 
From VMs to Containers: Introducing Docker Containers for Linux and Windows S...
From VMs to Containers: Introducing Docker Containers for Linux and Windows S...From VMs to Containers: Introducing Docker Containers for Linux and Windows S...
From VMs to Containers: Introducing Docker Containers for Linux and Windows S...
 
Production debugging web applications
Production debugging web applicationsProduction debugging web applications
Production debugging web applications
 
Real World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and ProductionReal World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and Production
 
ASP.NET Core 1.0
ASP.NET Core 1.0ASP.NET Core 1.0
ASP.NET Core 1.0
 
.Net Core
.Net Core.Net Core
.Net Core
 
Application Lifecycle Management with TFS
Application Lifecycle Management with TFSApplication Lifecycle Management with TFS
Application Lifecycle Management with TFS
 
Debugging your Way through .NET with Visual Studio 2015
Debugging your Way through .NET with Visual Studio 2015Debugging your Way through .NET with Visual Studio 2015
Debugging your Way through .NET with Visual Studio 2015
 

Último

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Último (20)

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 

Offline web applications

  • 1. Making web site available in offline mode @MehdiKhalili www.mehdi-Khalili.com
  • 2. That is two fold: 1. Use offline cache to get the browser to cache your website 2. Use client-side storage to let users change data in offline mode
  • 3. Offline cache (AKA AppCache) • Communicated through a manifest “file”: • set in the html tag’s manifest attribute • extension should be ‘appcache’ • mime type should be ‘text/cache-manifest’ • The manifest does not have to be static
  • 4.
  • 5. Some tips on AppCache • AppCache does NOT expire: so somehow version your manifest • Checkout out your cache entries on chrome://appcache-internals/
  • 6. Client side storage Web Storage Indexed Database • Great browser support • Relatively good browser support • Poor performance • Great performance • Simple to use • Rather complex API • A good choice ATM • All in all a good choice
  • 7. Web SQL - Deprecated!! • Good browser support (except IE and FF) • Good performance • Transactional • Familiar SQL • Perhaps not such a great choice
  • 8. Some tips on offline persistence • Store user changes in client storage in offline mode • Sync up as soon as you go online to avoid data loss • navigator.isOnline is broken. Don’t use it • Don’t use AJAX to check connectivity • Use AppCache events
  • 9. much more information on my blog http://www.mehdi-khalili.com/presentations/wdyk-offline-web @MehdiKhalili

Notas do Editor

  1. offline cache (also know as appcache) is the bit that makes some of the pages available in offline mode Client storage allows you to store data while in offline mode
  2. Show demos from the application