SlideShare a Scribd company logo
How Bitbucket Pipelines
Loads Connect UI Assets
Super-fast
PETER PLEWA | PRINCIPAL DEVELOPER | ATLASSIAN | @PP1EWA
It all started with a Spinner
Connect “Spinner” Flow
HOST HOST
EVENT
ADD-ON

IFRAME
HTML
LOAD
ALL.JSLOAD
PARSE
55% Connect
Add-ons load

in more than 1s*
Just use
CDN
and
Gzip
Agenda
Dos, Don’ts and Maybes
Webpack
Recap: Is there a spinner?
Measuring & Optimising
Agenda
Dos, Don’ts and Maybes
Webpack
Recap: Is there a spinner?
Measuring & Optimising
Agenda
Dos, Don’ts and Maybes
Webpack
Recap: Is there a spinner?
Measuring & Optimising
Agenda
Dos, Don’ts and Maybes
Webpack
Recap: Is there a spinner?
Measuring & Optimising
Agenda
Dos, Don’ts and Maybes
Webpack
Recap: Is there a spinner?
Measuring & Optimising
Single
Page
Application
Bundle
Front and 

Back-end
DON’T DO
HTTP/2HTTP/1
DODON’T
HTTP/2 You say
Enable HTTP/2 in CloudFront
HTTP
Caching
no-cache
no-store
DON’T DO
HTTP
caching
ETag
Cache-Control
Invalidation
ETag Header
Identifies the version of the document.
Revalidation
If-* headers check against the content of ETag.
ETag
Cache-Control
Invalidation
HTTP
caching
Cachability:
private, public, no-cache, no-store
Expiration:
max-age, s-maxage
Revalidation:
immutable, must-revalidate, proxy-revalidate
public max-age=3600
private immutable
no-cache
no-store
public max-age=3600 s-maxage=7200
public max-age=3600 proxy-revalidate
ETag
Cache-Control
Invalidation
Cache Busting
By adding query parameters to the request like
http://www.foobar.tld/some/page?v2
Cache Purging
Simply means to remove an item from the cache
HTTP
caching
Code
splitting
Large code
bundles
DON’T DO
Take control of
Connect JavaScript
Client (aka all.js)
MAYBE
Take control
of all.js
Reverse Proxy
Caching
Construct

all.js URL
Service
Workers
CACHE ALL.JS
INVALIDATE
Create own ALL.JS Cache
Inline all.js
Take control
of all.js
const host =
"https://d301sr5gafysq2.cloudfront.net/";
const bridgeUrl =
host + getUrlParam("crev") +
"/dist/connect/plugin.min.js";Reverse Proxy
Caching
Construct 

all.js URL
Service
Workers
Inline all.js
Take control
of all.js
Reverse Proxy
Caching
Construct 

all.js URL
Service
Workers
Inline all.js
<script>(function(f){if(typeof
exports==="object"&&typeof module!
=="undefined"){module.exports=f()}else
if(typeof define==="function"&&define.amd)
{define([],f)}else{var...</script>
Take control
of all.js Use SW to interact with Cache
Intercept all.js request and save it as a resource in
cache.
Run Background Sync
Service Worker can check if new all.js is available
and update it’s current version.
Reverse Proxy
Caching
Construct

all.js URL
Service
Workers
Inline all.js
Maybe
GraphQL
Server Side
Rendering
Service
Workers
query Heroes($episode: Episode) {
hero(episode: $episode) {
name
friends {
name
}
}
}
{
"episode": "JEDI"
}
{
"data": {
"hero": "R2-D2",
"friends": [{
"name": "Luke Skywalker"
}, {
"name": "Han Solo"
}, {
"name": "Leia Organa"
}]
}
}
Variables
Query Data
Maybe
GraphQL
Server Side
Rendering
Service
Workers
query Heroes($episode: Episode) {
hero(episode: $episode) {
name
friends {
name
}
}
}
{
"episode": "JEDI"
}
{
"data": {
"hero": "R2-D2",
"friends": [{
"name": "Luke Skywalker"
}, {
"name": "Han Solo"
}, {
"name": "Leia Organa"
}]
}
}
Variables
Query Data
Maybe
GraphQL
Server Side
Rendering
Service
Workers
query Heroes($episode: Episode) {
hero(episode: $episode) {
name
friends {
name
}
}
}
{
"episode": "JEDI"
}
{
"data": {
"hero": "R2-D2",
"friends": [{
"name": "Luke Skywalker"
}, {
"name": "Han Solo"
}, {
"name": "Leia Organa"
}]
}
}
Variables
Query Data
Maybe
GraphQL
Server Side
Rendering
Service
Workers
query Heroes($episode: Episode) {
hero(episode: $episode) {
name
friends {
name
}
}
}
{
"episode": "JEDI"
}
{
"data": {
"hero": "R2-D2",
"friends": [{
"name": "Luke Skywalker"
}, {
"name": "Han Solo"
}, {
"name": "Leia Organa"
}]
}
}
Variables
Query Data
import { renderToString } from 'react-dom/server' 



function handleRender(req, res) {
const store = createStore(counterApp)
// Render the component to a string
const html = renderToString(
<Provider store={store}>
<App />
</Provider>
)
// Grab the initial state from our Redux store
const preloadedState = store.getState()
// Send the rendered page back to the client
res.send(renderFullPage(html, preloadedState))
}
Maybe
GraphQL
Server Side
Rendering
Service
Workers
import { renderToString } from 'react-dom/server' 



function handleRender(req, res) {
const store = createStore(counterApp)
// Render the component to a string
const html = renderToString(
<Provider store={store}>
<App />
</Provider>
)
// Grab the initial state from our Redux store
const preloadedState = store.getState()
// Send the rendered page back to the client
res.send(renderFullPage(html, preloadedState))
}
Maybe
GraphQL
Server Side
Rendering
Service
Workers
Maybe
GraphQL
Server Side
Rendering
Service
Workers
What is Service Worker?
A script that your browser runs in the background,
separate from a web page, opening the door to
features that don't need a web page or user
interaction.
Agenda
Dos, Don’ts and Maybes
Webpack
Recap: Is there a spinner?
Measuring & Optimising
Measure
Apdex
First Meaningful
Paint
Performance
Budget
Tools
Measuring User Satisfaction
Level Multiplier Time (T Example = 1)
Satisfied T or less Less than 1 seconds
Tolerated >T, <= 4T Between 1 and 4 seconds
Frustrated > 4T Greater than 4 seconds
Measure
Apdex
First Meaningful
Paint
Performance
Budget
Tools
Measuring User Satisfaction
Level Multiplier Time (T Example = 1)
Satisfied T or less Less than 1 seconds
Tolerated >T, <= 4T Between 1 and 4 seconds
Frustrated > 4T Greater than 4 seconds
Example: (170 + (20/2))/200 = 0.9
Satisfied requests + (Tolerating requests / 2)
Total number of requests
Apdex =
Measure
Apdex
First Meaningful
Paint
Performance
Budget
Tools
Time to First Meaningful Paint
Measure
Apdex
First Meaningful
Paint
Performance
Budget
Tools
Setting a Performance Budget
Measure
Apdex
First Meaningful
Paint
Performance
Budget
Tools
Lighthouse Chrome Dev Tools
Connect Analytics Chrome Extension
bit.ly/connect-analytics
How Bitbucket Pipelines Loads Connect UI Assets Super-fast
Agenda
Dos, Don’ts and Maybes
Webpack
Recap: Is there a spinner?
Measuring & Optimising
WHAT IS WEBPACK?
module.exports = {
entry: "./entry.js",
output: {
path: __dirname,
filename: "bundle.js"

},
module: {
loaders: [{
test: /.css$/,
loader: "style!css"
}]

}
}
Webpack
Config
Entry
Output
Loaders
Plugins
module.exports = {
entry: "./entry.js",
output: {
path: __dirname,
filename: "bundle.js"

},
module: {
loaders: [{
test: /.css$/,
loader: "style!css"
}]

}
}
Webpack
Config
Entry
Output
Loaders
Plugins
module.exports = {
entry: "./entry.js",
output: {
path: __dirname,
filename: "bundle.js"

},
module: {
loaders: [{
test: /.css$/,
loader: "style!css"
}]

}
}
Webpack
Config
Entry
Output
Loaders
Plugins
module.exports = {
entry: "./entry.js",
output: {
path: __dirname,
filename: "bundle.js"

},
plugins: [
new webpack.optimize.UglifyJsPlugin(),
new HtmlWebpackPlugin({
template: "./src/index.html"
})

]
}
Webpack
Config
Entry
Output
Loaders
Plugins
Webpack
Progression
One giant
bundle
Separate
vendor chunk
Code splitting
Downloaded on
every page load
Only one HTTP
request
Gets bigger over
time
! !
$ webpack ./app.js ./dist/bundle.js
Webpack
Progression
One giant
bundle
Separate
vendor chunk
Code splitting
Less frequent
cache invalidation
Still gets bigger
over time
App bundle contains
“just” your code
!
entry: {
// Infrequently changed: e.g. react, lodash
vendor: ["./entry.js"],
// Frequently changed
app: ["./src/app.js"]
}
Webpack
Progression
One giant
bundle
Separate
vendor chunk
Code splitting
Lazy-load chunks
for some logic
Difficult to
setup
Cache invalidation
in small chunks
!
import("moment")
.then(moment => moment().format("LLLL"))
.then(str => console.log(str))
.then(err =>
console.log("Failed to load", err)
)
WEBPACK CODE SPLITTING
Bundle with
content-based hash
output: {
chunkFilename: "[chunkhash].bundle.js"
}
WEBPACK CODE SPLITTING
Prioritise async chunks with
<rel=“preload”>
import("lazy-loaded-module")
<link rel="preload" href="chunk.31132ae6.js" as="script">
WEBPACK CODE SPLITTING
How
does
preload
work?
Before preload, the network request started here
After preload, it has shifted left - right at parse time
BundleAnalyzer
PreloadWebpack
OptimizeJs
SWPrecache
HtmlWebpack
Essential
Webpack
Plugins
BundleAnalyzer
PreloadWebpack
OptimizeJs
SWPrecache
HtmlWebpack
Essential
Webpack
Plugins
Optimize JS for faster execution
by wrapping all immediately-invoked functions or
likely-to-be-invoked functions in parentheses.
BundleAnalyzer
PreloadWebpack
OptimizeJs
SWPrecache
HtmlWebpack
Essential
Webpack
Plugins
Browser Typical speed boost
Chrome 55 20.63%
Edge 14 13.52%
Firefox 50 8.26%
Safari 10 -1.04%
Simplify creation of Service Workers
That includes all your webpack bundles.
BundleAnalyzer
PreloadWebpack
OptimizeJs
SWPrecache
HtmlWebpack
Essential
Webpack
Plugins
module.exports = {
...
plugins: [
new SWPrecacheWebpackPlugin()
],
...
}
Simplify creation of HTML
That includes all your webpack bundles.
BundleAnalyzer
PreloadWebpack
OptimizeJs
SWPrecache
HtmlWebpack
Essential
Webpack
Plugins
module.exports = {
plugins: [new HtmlWebpackPlugin()],
}
<!DOCTYPE html>
<html>
<head>
<title>webpack App</title>
</head>
<body>
<script src="index_bundle.js"></script>
</body>
</html>
Additional webpack tips
Tree Shaking
Removes unused code
producing smaller bundles.
Hot Reloading
Replaces modules in the
real time without the need
to refresh browser.
Ecosystem
Huge amount of plugins and
available tools that extend
webpack.
Agenda
Dos, Don’ts and Maybes
Webpack
Recap: Is there a spinner?
Measuring & Optimising
There is no spinner?
Is there a
spinner?
Want no spinner? Maintain Apdex ~ 0.8
Thank you!
PETER PLEWA | PRINCIPAL DEVELOPER | ATLASSIAN | @PP1EWA
bit.ly/connect-analytics

More Related Content

PDF
How to Build a Better JIRA Add-on
PDF
Ten Battle-Tested Tips for Atlassian Connect Add-ons
PDF
What's New with Confluence Connect
PDF
Creating Your Own Server Add-on that Customizes Confluence or JIRA
PDF
Integration Testing on Steroids: Run Your Tests on the Real Things
PDF
Updates on the Data Center Apps Program
PDF
Practical Patterns for Developing a Cross-product Cross-version App
PDF
What's New in Jira Cloud for Developers
How to Build a Better JIRA Add-on
Ten Battle-Tested Tips for Atlassian Connect Add-ons
What's New with Confluence Connect
Creating Your Own Server Add-on that Customizes Confluence or JIRA
Integration Testing on Steroids: Run Your Tests on the Real Things
Updates on the Data Center Apps Program
Practical Patterns for Developing a Cross-product Cross-version App
What's New in Jira Cloud for Developers

What's hot (20)

PDF
Access to User Activities - Activity Platform APIs
PDF
4 Changes We're Making to Help you be Successful in the Cloud
PDF
The User Who Must Not be Named: GDPR and Your Jira App
PDF
Spec-first API Design for Speed and Safety
PDF
Building a Cerberus App Without Losing Our Heads: The Passage to a Cross-Plat...
PDF
Designing and Running a GraphQL API
PDF
Integrate CI/CD Pipelines with Jira Software Cloud
PDF
Supercharge Your Pages - New Ways to Extend the Confluence Editor
PDF
The New & Improved Confluence Server and Data Center
PDF
Take Action with Forge Triggers
PDF
Leaning into Server to Cloud App Migration
PDF
Scaling Indexing and Replication in Jira Data Center Apps
PDF
Building Faster With Your Team's UI Kit
PDF
Spring Boot & Actuators
PPTX
Next level of Appium
PDF
Declaring Server App Components in Pure Java
PPTX
Introduction to Firebase [Google I/O Extended Bangkok 2016]
PPTX
Building ColdFusion And AngularJS Applications
PDF
Firebase Basics - Dialog Demo for Group Tech Staff
PPTX
HATEOAS 101 - Opinionated Introduction to a REST API Style
Access to User Activities - Activity Platform APIs
4 Changes We're Making to Help you be Successful in the Cloud
The User Who Must Not be Named: GDPR and Your Jira App
Spec-first API Design for Speed and Safety
Building a Cerberus App Without Losing Our Heads: The Passage to a Cross-Plat...
Designing and Running a GraphQL API
Integrate CI/CD Pipelines with Jira Software Cloud
Supercharge Your Pages - New Ways to Extend the Confluence Editor
The New & Improved Confluence Server and Data Center
Take Action with Forge Triggers
Leaning into Server to Cloud App Migration
Scaling Indexing and Replication in Jira Data Center Apps
Building Faster With Your Team's UI Kit
Spring Boot & Actuators
Next level of Appium
Declaring Server App Components in Pure Java
Introduction to Firebase [Google I/O Extended Bangkok 2016]
Building ColdFusion And AngularJS Applications
Firebase Basics - Dialog Demo for Group Tech Staff
HATEOAS 101 - Opinionated Introduction to a REST API Style
Ad

Viewers also liked (20)

PDF
Shipping to Server and Cloud with Docker
PDF
Securing Your Atlassian Connect Add-on With JWT
PDF
Build a JIRA Server Add-on as a Microservice - You Can Do It!
PDF
Bringing Server Add-ons to the Cloud and Back Again
PDF
Building Search for Bitbucket Cloud
PDF
React for Re-use: Creating UI Components with Confluence Connect
PDF
Tempo’s Journey Into the Cloud
PDF
Atlassian Connect on Serverless Platforms: Low Cost Add-Ons
PDF
Building for the Future: Design Your Add-on with Tomorrow in Mind
PDF
Server Add-ons for Front-end Developers
PDF
Designing Add-ons for Atlassian Products, the Do’s & Don’ts
PDF
Know Thy Product: Tips from a Tester
PDF
Closing the Deal: How Atlassian Partners Help Grow Your User Base
PDF
Launch into New Markets with JIRA Service Desk
PDF
Connect First, Ask Confluence Questions Later
PDF
Beyond Agile and DevOps: From Concepts to Products in Weeks, Not Months
PDF
12 Ways to Supercharge Your Connect Add-on
PDF
How to Write a Chatbot that Gets Smarter
PDF
How to Make Customer Support Your Product's Greatest Feature
PDF
How to be Successful in the DevOps Business
Shipping to Server and Cloud with Docker
Securing Your Atlassian Connect Add-on With JWT
Build a JIRA Server Add-on as a Microservice - You Can Do It!
Bringing Server Add-ons to the Cloud and Back Again
Building Search for Bitbucket Cloud
React for Re-use: Creating UI Components with Confluence Connect
Tempo’s Journey Into the Cloud
Atlassian Connect on Serverless Platforms: Low Cost Add-Ons
Building for the Future: Design Your Add-on with Tomorrow in Mind
Server Add-ons for Front-end Developers
Designing Add-ons for Atlassian Products, the Do’s & Don’ts
Know Thy Product: Tips from a Tester
Closing the Deal: How Atlassian Partners Help Grow Your User Base
Launch into New Markets with JIRA Service Desk
Connect First, Ask Confluence Questions Later
Beyond Agile and DevOps: From Concepts to Products in Weeks, Not Months
12 Ways to Supercharge Your Connect Add-on
How to Write a Chatbot that Gets Smarter
How to Make Customer Support Your Product's Greatest Feature
How to be Successful in the DevOps Business
Ad

Similar to How Bitbucket Pipelines Loads Connect UI Assets Super-fast (20)

PDF
How to Webpack your Django!
PPTX
Django + Vue, JavaScript de 3ª generación para modernizar Django
PDF
Bringing the JAMstack to the Enterprise
PDF
Front End Development for Back End Java Developers - Jfokus 2020
PDF
Rapid Application Development with WSO2 Platform
PDF
Building Universal Web Apps with React ForwardJS 2017
PDF
Behavior Driven Development and Automation Testing Using Cucumber
PDF
Maciej Treder "Server-side rendering with Angular—be faster and more SEO, CDN...
PDF
Progressive web apps
PDF
Keeping the frontend under control with Symfony and Webpack
PDF
Building and deploying React applications
PPTX
Google app engine by example
PDF
Server side rendering with React and Symfony
PDF
Rails 6 frontend frameworks
PDF
Maciej Treder ''Angular Universal - a medicine for the Angular + SEO/CDN issu...
PPTX
Building Progressive Web Apps for Windows devices
PPTX
WordCamp Montreal 2016 WP-API + React with server rendering
PDF
Workshop: Building Vaadin add-ons
PDF
Integrating React.js Into a PHP Application
PDF
Rest web service_with_spring_hateoas
How to Webpack your Django!
Django + Vue, JavaScript de 3ª generación para modernizar Django
Bringing the JAMstack to the Enterprise
Front End Development for Back End Java Developers - Jfokus 2020
Rapid Application Development with WSO2 Platform
Building Universal Web Apps with React ForwardJS 2017
Behavior Driven Development and Automation Testing Using Cucumber
Maciej Treder "Server-side rendering with Angular—be faster and more SEO, CDN...
Progressive web apps
Keeping the frontend under control with Symfony and Webpack
Building and deploying React applications
Google app engine by example
Server side rendering with React and Symfony
Rails 6 frontend frameworks
Maciej Treder ''Angular Universal - a medicine for the Angular + SEO/CDN issu...
Building Progressive Web Apps for Windows devices
WordCamp Montreal 2016 WP-API + React with server rendering
Workshop: Building Vaadin add-ons
Integrating React.js Into a PHP Application
Rest web service_with_spring_hateoas

More from Atlassian (20)

PPTX
International Women's Day 2020
PDF
10 emerging trends that will unbreak your workplace in 2020
PDF
Forge App Showcase
PDF
Let's Build an Editor Macro with Forge UI
PDF
Meet the Forge Runtime
PDF
Forge UI: A New Way to Customize the Atlassian User Experience
PDF
Observability and Troubleshooting in Forge
PDF
Trusted by Default: The Forge Security & Privacy Model
PDF
Designing Forge UI: A Story of Designing an App UI System
PDF
Forge: Under the Hood
PDF
Design Your Next App with the Atlassian Vendor Sketch Plugin
PDF
Tear Up Your Roadmap and Get Out of the Building
PDF
Nailing Measurement: a Framework for Measuring Metrics that Matter
PDF
Building Apps With Color Blind Users in Mind
PDF
Creating Inclusive Experiences: Balancing Personality and Accessibility in UX...
PDF
Beyond Diversity: A Guide to Building Balanced Teams
PDF
The Road(map) to Las Vegas - The Story of an Emerging Self-Managed Team
PDF
Building Apps With Enterprise in Mind
PDF
Shipping With Velocity and Confidence Using Feature Flags
PDF
Build With Heart and Balance, Remote Work Edition
International Women's Day 2020
10 emerging trends that will unbreak your workplace in 2020
Forge App Showcase
Let's Build an Editor Macro with Forge UI
Meet the Forge Runtime
Forge UI: A New Way to Customize the Atlassian User Experience
Observability and Troubleshooting in Forge
Trusted by Default: The Forge Security & Privacy Model
Designing Forge UI: A Story of Designing an App UI System
Forge: Under the Hood
Design Your Next App with the Atlassian Vendor Sketch Plugin
Tear Up Your Roadmap and Get Out of the Building
Nailing Measurement: a Framework for Measuring Metrics that Matter
Building Apps With Color Blind Users in Mind
Creating Inclusive Experiences: Balancing Personality and Accessibility in UX...
Beyond Diversity: A Guide to Building Balanced Teams
The Road(map) to Las Vegas - The Story of an Emerging Self-Managed Team
Building Apps With Enterprise in Mind
Shipping With Velocity and Confidence Using Feature Flags
Build With Heart and Balance, Remote Work Edition

Recently uploaded (20)

PDF
System and Network Administraation Chapter 3
PDF
AI in Product Development-omnex systems
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PPTX
history of c programming in notes for students .pptx
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PDF
top salesforce developer skills in 2025.pdf
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PPTX
Introduction to Artificial Intelligence
PDF
Nekopoi APK 2025 free lastest update
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
System and Network Administraation Chapter 3
AI in Product Development-omnex systems
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
history of c programming in notes for students .pptx
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Softaken Excel to vCard Converter Software.pdf
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
top salesforce developer skills in 2025.pdf
Which alternative to Crystal Reports is best for small or large businesses.pdf
Introduction to Artificial Intelligence
Nekopoi APK 2025 free lastest update
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
Wondershare Filmora 15 Crack With Activation Key [2025
Odoo Companies in India – Driving Business Transformation.pdf
Design an Analysis of Algorithms II-SECS-1021-03
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Upgrade and Innovation Strategies for SAP ERP Customers

How Bitbucket Pipelines Loads Connect UI Assets Super-fast