SlideShare uma empresa Scribd logo
1 de 25
June 2013
Prepared By 
Transitioning from Web Sites to Web Apps with the History API
2	

Tom Conte
2	

•  Senior SEO Strategist
•  www.morpheusmedia.com
•  tomconte@morpheusmedia.com
•  @cometton
@cometton | #smx
3	

3	

Websites using standards-based JavaScript
APIs provide richer web experiences, similar
to native apps, without sacrificing browser
or site usability.
@cometton | #smx
4	

Native Apps vs Web Sites
4	

•  Which is more inviting?
@cometton | #smx
5	

Facebook Mobile Web vs Native App Usage
5	

•  Not only do users want it, but it’s cheaper and ubiquitous
@cometton | #smx
6	

Web Apps
6	

•  Update states, not pages to provide faster and responsive experiences
@cometton | #smx
7	

Ajax + History API
7	

•  Pros:
•  Rich experience
•  Performance benefits
•  Browser features are usable
•  URLs can be bookmarked
•  URLs can be indexed
•  URLs can be shared
•  Old URLs can be redirected
•  Page weight is lighter
•  Doesn’t require server configuration
•  Accessible without JavaScript
•  Cons
•  Limited browser support and
compatibility (for now)
@cometton | #smx
8	

A&E: A Case Study
8	

@cometton | #smx
9	

A&E Photo Galleries
9	

•  Some galleries were built in Flash others with a hash (#)
•  All unique content was placed on one page
•  Long load times
•  Images weren’t always indexed
The hash limited the success of photo galleries
@cometton | #smx
10	

The Challenge
10	

•  User Experience
•  Native-like: Fast, seamless, responsive
•  Crawlability
•  Unique URLs for each gallery image
•  Relevancy
•  A single title, caption, and image per URL
•  Accessibility
•  Works in the most basic of browsers
@cometton | #smx
11	

Step 1
11	

•  Build a photo gallery to function
using HTML and PHP only
•  Title tag is set as the image title
•  Meta Description is set as the image
caption
•  URL pathname is set as the image
filename
<a href=“/page” id=“prev”>
<img src=“prev.gif” alt=“Previous” />
</a>
Image Caption
Image
Image Title
>
>
Thumbnail Thumbnail Thumbnail >
>
Link > Link > Link
Gallery More Galleries
@cometton | #smx
12	

Step 2
12	

•  Set an on-click event on the “previous” button (Hijax)
var link = document.getElementById(”prev");
link.onclick = function () {
alert("I'm using unobstrusive JavaScript!");
return false;
}
@cometton | #smx
13	

Step 3
13	

•  Update the URL in the browser with a path
var link = document.getElementById(”prev");
link.onclick = function () {
history.pushState(null, null, swapHTML(link.href));
return false;
}
@cometton | #smx
14	

Step 4
14	

•  Asynchronously update the page’s content to a new state
function swapHTML(href) {
var req = new XMLHttpRequest();
req.open("GET”, “http://example.com/gallery/” + href.split("/").pop(), false);
req.send(null);
if (req.status == 200) {
document.getElementById("gallery").innerHTML = req.responseText;
var link = document.getElementById(“prev”);
link.onclick = function () {
history.pushState(null, null, swapHTML(link.href));
return false;
}
return true;
}
return false;
}
@cometton | #smx
15	

Step 5
15	

•  Configure analytics tracking and back-button functionality
window.onload = function() {
swapHTML(location.pathname)
_gaq.push(['_trackPageview', “/virtual/” + location.pathname]);
window.addEventListener("popstate", function() {
swapHTML(location.pathname);
}, false);
}
@cometton | #smx
16	

Results: Month 1
16	

•  Gallery landing page ranks in the
1st position
•  Nothing changed
@cometton | #smx
17	

Results: Month 2
17	

•  3 sub-pages of the gallery ranked
in the first 4 positions
@cometton | #smx
18	

Results: Month 3
18	

•  Mega-sitelinks appear for the main
gallery page
•  2nd position is occupied by another
sub-page with it’s own sitelinks
@cometton | #smx
19	

Results: 1 Year Later
19	

•  1st two positions are owned by
client each with sitelinks
•  Although competition has increased,
visibility is stable
@cometton | #smx
20	

Results: Increased Organic Traffic
20	

•  351% increase 3 months after re-launch of a Storage Wars photo gallery
@cometton | #smx
0"
10,000"
20,000"
30,000"
40,000"
50,000"
60,000"
70,000"
80,000"
90,000"
Storage(Wars(Organic(Traffic(
3"Months"Pre6Launch"
3"Months"Post6Launch"
21	

Our Job is Never Done…
21	

•  Implement rel next and prev
•  Share page equity across the entire gallery
•  Execute scripts on demand
•  Prioritize the order in which content is downloaded
•  Pre-fetch content
•  Load new content in anticipation of user actions
@cometton | #smx
22	

Other Uses of the History API
22	

•  Infinite Scroll
•  Push a new URL for each additional content request
•  Continuous playback
•  Avoid interrupting music play while browsing a site
@cometton | #smx
23	

Final Thoughts
23	

•  Close the gap between native and the web with JavaScript APIs
Geolocation
Local Storage
WebSockets
Video & Audio
Web Workers
Server Events
Page VisibilityCanvas
Messaging
@cometton | #smx
24	

Resources
24	

•  Learn more about JavaScript by following Jeremy Keith (@adactio)
@cometton | #smx
25	

Thank You!
25	

•  Tom Conte
•  @cometton
•  www.cometton.com
•  tomconte@morpheusmedia.com
•  Morpheus Media
•  @morpheusmedia
•  www.morpheusmedia.com
•  morpheusmedia.tumblr.com

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

Code splitting with server side react
Code splitting with server side reactCode splitting with server side react
Code splitting with server side react
 
Ruby Real life Perfomance
Ruby Real life PerfomanceRuby Real life Perfomance
Ruby Real life Perfomance
 
Core Web Vitals - The Modern Web Experience
Core Web Vitals - The Modern Web ExperienceCore Web Vitals - The Modern Web Experience
Core Web Vitals - The Modern Web Experience
 
Vagrant Plugin development
Vagrant Plugin developmentVagrant Plugin development
Vagrant Plugin development
 
Core web Vitals: Web Performance and Usability
Core web Vitals: Web Performance and UsabilityCore web Vitals: Web Performance and Usability
Core web Vitals: Web Performance and Usability
 
Basic Terms
Basic TermsBasic Terms
Basic Terms
 
Performance tuning of Websites
Performance tuning of WebsitesPerformance tuning of Websites
Performance tuning of Websites
 
Dvr Summary
Dvr SummaryDvr Summary
Dvr Summary
 
2 Seconds is the New Slow - Chris Simmance - under2
2 Seconds is the New Slow -  Chris Simmance - under22 Seconds is the New Slow -  Chris Simmance - under2
2 Seconds is the New Slow - Chris Simmance - under2
 
Salesforce Flexible Pages
Salesforce Flexible PagesSalesforce Flexible Pages
Salesforce Flexible Pages
 
Dynamic Rendering for SEO by Nati Elimelech
Dynamic Rendering for SEO by Nati ElimelechDynamic Rendering for SEO by Nati Elimelech
Dynamic Rendering for SEO by Nati Elimelech
 
Future of the Web
Future of the WebFuture of the Web
Future of the Web
 
Introduction core web vitals
Introduction core web vitalsIntroduction core web vitals
Introduction core web vitals
 
Lessons Learned from Using Next.js in Production
Lessons Learned from Using Next.js in ProductionLessons Learned from Using Next.js in Production
Lessons Learned from Using Next.js in Production
 
The Future of the web
The Future of the webThe Future of the web
The Future of the web
 
Salesforce winter 16 release
Salesforce winter 16 releaseSalesforce winter 16 release
Salesforce winter 16 release
 
Google Core Web Vitals - Webinar
Google Core Web Vitals - WebinarGoogle Core Web Vitals - Webinar
Google Core Web Vitals - Webinar
 
SharePoint Saturday Cincinnati 2014 - CSOM
SharePoint Saturday Cincinnati 2014 - CSOMSharePoint Saturday Cincinnati 2014 - CSOM
SharePoint Saturday Cincinnati 2014 - CSOM
 
React BKK: Scalable Application Architecture
React BKK: Scalable Application ArchitectureReact BKK: Scalable Application Architecture
React BKK: Scalable Application Architecture
 
Flux
FluxFlux
Flux
 

Semelhante a Transitioning from Web Sites to Web Apps with the History API: SMX Advanced 2013

Web app with j query &amp; javascript (5:4)
Web app with j query &amp; javascript (5:4)Web app with j query &amp; javascript (5:4)
Web app with j query &amp; javascript (5:4)
Thinkful
 

Semelhante a Transitioning from Web Sites to Web Apps with the History API: SMX Advanced 2013 (20)

Web Components at Scale, HTML5DevConf 2014-10-21
Web Components at Scale, HTML5DevConf 2014-10-21Web Components at Scale, HTML5DevConf 2014-10-21
Web Components at Scale, HTML5DevConf 2014-10-21
 
2012.10 Liferay Europe Symposium, Alistair Oldfield
2012.10 Liferay Europe Symposium, Alistair Oldfield2012.10 Liferay Europe Symposium, Alistair Oldfield
2012.10 Liferay Europe Symposium, Alistair Oldfield
 
2012.10 Oldfield
2012.10 Oldfield2012.10 Oldfield
2012.10 Oldfield
 
BlogForever Crawler: Techniques and algorithms to harvest modern weblogs Pres...
BlogForever Crawler: Techniques and algorithms to harvest modern weblogs Pres...BlogForever Crawler: Techniques and algorithms to harvest modern weblogs Pres...
BlogForever Crawler: Techniques and algorithms to harvest modern weblogs Pres...
 
Rise and Fall of the Frontend Developer
Rise and Fall of the Frontend DeveloperRise and Fall of the Frontend Developer
Rise and Fall of the Frontend Developer
 
Web browser architecture
Web browser architectureWeb browser architecture
Web browser architecture
 
Performance and Scalability Art of Isomorphic React Applications
Performance and Scalability Art of Isomorphic React ApplicationsPerformance and Scalability Art of Isomorphic React Applications
Performance and Scalability Art of Isomorphic React Applications
 
Static Site Generators - Developing Websites in Low-resource Condition
Static Site Generators - Developing Websites in Low-resource ConditionStatic Site Generators - Developing Websites in Low-resource Condition
Static Site Generators - Developing Websites in Low-resource Condition
 
13 Things Developers Forget When Launching Public Websites
13 Things Developers Forget When Launching Public Websites13 Things Developers Forget When Launching Public Websites
13 Things Developers Forget When Launching Public Websites
 
Web Components: The Future of Web Development is Here
Web Components: The Future of Web Development is HereWeb Components: The Future of Web Development is Here
Web Components: The Future of Web Development is Here
 
10 things you can do to speed up your web app today 2016
10 things you can do to speed up your web app today 201610 things you can do to speed up your web app today 2016
10 things you can do to speed up your web app today 2016
 
What's new in Sitecore 9.3
What's new in Sitecore 9.3What's new in Sitecore 9.3
What's new in Sitecore 9.3
 
Why Upgrade to v8.6?
Why Upgrade to v8.6?Why Upgrade to v8.6?
Why Upgrade to v8.6?
 
Automating Site Provisioning in SharePoint - Presented 7/27/13 at SharePoint ...
Automating Site Provisioning in SharePoint - Presented 7/27/13 at SharePoint ...Automating Site Provisioning in SharePoint - Presented 7/27/13 at SharePoint ...
Automating Site Provisioning in SharePoint - Presented 7/27/13 at SharePoint ...
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Web app with j query &amp; javascript (5:4)
Web app with j query &amp; javascript (5:4)Web app with j query &amp; javascript (5:4)
Web app with j query &amp; javascript (5:4)
 
The SEO Utility Belt
The SEO Utility BeltThe SEO Utility Belt
The SEO Utility Belt
 
Csun retrofitting anoosha&amp;sathish-2
Csun retrofitting anoosha&amp;sathish-2Csun retrofitting anoosha&amp;sathish-2
Csun retrofitting anoosha&amp;sathish-2
 
Web Components: The Future of Web Development is Here
Web Components: The Future of Web Development is HereWeb Components: The Future of Web Development is Here
Web Components: The Future of Web Development is Here
 
TechSEO Boost 2017: SEO Best Practices for JavaScript T-Based Websites
TechSEO Boost 2017: SEO Best Practices for JavaScript T-Based WebsitesTechSEO Boost 2017: SEO Best Practices for JavaScript T-Based Websites
TechSEO Boost 2017: SEO Best Practices for JavaScript T-Based Websites
 

Último

Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
UXDXConf
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Peter Udo Diehl
 

Último (20)

Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
 
AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John Staveley
 
Oauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftOauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoft
 
ECS 2024 Teams Premium - Pretty Secure
ECS 2024   Teams Premium - Pretty SecureECS 2024   Teams Premium - Pretty Secure
ECS 2024 Teams Premium - Pretty Secure
 
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System Strategy
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
 
Syngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdf
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
 
Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM Performance
 
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties ReimaginedEasier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří Karpíšek
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and Planning
 
Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
 

Transitioning from Web Sites to Web Apps with the History API: SMX Advanced 2013

  • 1. June 2013 Prepared By Transitioning from Web Sites to Web Apps with the History API
  • 2. 2 Tom Conte 2 •  Senior SEO Strategist •  www.morpheusmedia.com •  tomconte@morpheusmedia.com •  @cometton @cometton | #smx
  • 3. 3 3 Websites using standards-based JavaScript APIs provide richer web experiences, similar to native apps, without sacrificing browser or site usability. @cometton | #smx
  • 4. 4 Native Apps vs Web Sites 4 •  Which is more inviting? @cometton | #smx
  • 5. 5 Facebook Mobile Web vs Native App Usage 5 •  Not only do users want it, but it’s cheaper and ubiquitous @cometton | #smx
  • 6. 6 Web Apps 6 •  Update states, not pages to provide faster and responsive experiences @cometton | #smx
  • 7. 7 Ajax + History API 7 •  Pros: •  Rich experience •  Performance benefits •  Browser features are usable •  URLs can be bookmarked •  URLs can be indexed •  URLs can be shared •  Old URLs can be redirected •  Page weight is lighter •  Doesn’t require server configuration •  Accessible without JavaScript •  Cons •  Limited browser support and compatibility (for now) @cometton | #smx
  • 8. 8 A&E: A Case Study 8 @cometton | #smx
  • 9. 9 A&E Photo Galleries 9 •  Some galleries were built in Flash others with a hash (#) •  All unique content was placed on one page •  Long load times •  Images weren’t always indexed The hash limited the success of photo galleries @cometton | #smx
  • 10. 10 The Challenge 10 •  User Experience •  Native-like: Fast, seamless, responsive •  Crawlability •  Unique URLs for each gallery image •  Relevancy •  A single title, caption, and image per URL •  Accessibility •  Works in the most basic of browsers @cometton | #smx
  • 11. 11 Step 1 11 •  Build a photo gallery to function using HTML and PHP only •  Title tag is set as the image title •  Meta Description is set as the image caption •  URL pathname is set as the image filename <a href=“/page” id=“prev”> <img src=“prev.gif” alt=“Previous” /> </a> Image Caption Image Image Title > > Thumbnail Thumbnail Thumbnail > > Link > Link > Link Gallery More Galleries @cometton | #smx
  • 12. 12 Step 2 12 •  Set an on-click event on the “previous” button (Hijax) var link = document.getElementById(”prev"); link.onclick = function () { alert("I'm using unobstrusive JavaScript!"); return false; } @cometton | #smx
  • 13. 13 Step 3 13 •  Update the URL in the browser with a path var link = document.getElementById(”prev"); link.onclick = function () { history.pushState(null, null, swapHTML(link.href)); return false; } @cometton | #smx
  • 14. 14 Step 4 14 •  Asynchronously update the page’s content to a new state function swapHTML(href) { var req = new XMLHttpRequest(); req.open("GET”, “http://example.com/gallery/” + href.split("/").pop(), false); req.send(null); if (req.status == 200) { document.getElementById("gallery").innerHTML = req.responseText; var link = document.getElementById(“prev”); link.onclick = function () { history.pushState(null, null, swapHTML(link.href)); return false; } return true; } return false; } @cometton | #smx
  • 15. 15 Step 5 15 •  Configure analytics tracking and back-button functionality window.onload = function() { swapHTML(location.pathname) _gaq.push(['_trackPageview', “/virtual/” + location.pathname]); window.addEventListener("popstate", function() { swapHTML(location.pathname); }, false); } @cometton | #smx
  • 16. 16 Results: Month 1 16 •  Gallery landing page ranks in the 1st position •  Nothing changed @cometton | #smx
  • 17. 17 Results: Month 2 17 •  3 sub-pages of the gallery ranked in the first 4 positions @cometton | #smx
  • 18. 18 Results: Month 3 18 •  Mega-sitelinks appear for the main gallery page •  2nd position is occupied by another sub-page with it’s own sitelinks @cometton | #smx
  • 19. 19 Results: 1 Year Later 19 •  1st two positions are owned by client each with sitelinks •  Although competition has increased, visibility is stable @cometton | #smx
  • 20. 20 Results: Increased Organic Traffic 20 •  351% increase 3 months after re-launch of a Storage Wars photo gallery @cometton | #smx 0" 10,000" 20,000" 30,000" 40,000" 50,000" 60,000" 70,000" 80,000" 90,000" Storage(Wars(Organic(Traffic( 3"Months"Pre6Launch" 3"Months"Post6Launch"
  • 21. 21 Our Job is Never Done… 21 •  Implement rel next and prev •  Share page equity across the entire gallery •  Execute scripts on demand •  Prioritize the order in which content is downloaded •  Pre-fetch content •  Load new content in anticipation of user actions @cometton | #smx
  • 22. 22 Other Uses of the History API 22 •  Infinite Scroll •  Push a new URL for each additional content request •  Continuous playback •  Avoid interrupting music play while browsing a site @cometton | #smx
  • 23. 23 Final Thoughts 23 •  Close the gap between native and the web with JavaScript APIs Geolocation Local Storage WebSockets Video & Audio Web Workers Server Events Page VisibilityCanvas Messaging @cometton | #smx
  • 24. 24 Resources 24 •  Learn more about JavaScript by following Jeremy Keith (@adactio) @cometton | #smx
  • 25. 25 Thank You! 25 •  Tom Conte •  @cometton •  www.cometton.com •  tomconte@morpheusmedia.com •  Morpheus Media •  @morpheusmedia •  www.morpheusmedia.com •  morpheusmedia.tumblr.com