SlideShare a Scribd company logo
Site Optimization Tips
for developers
By
Adnan Siddiqi
(http://adnansiddiqi.me)
Why Optimize?
β€’ Hundreds of websites are being launched everyday
which are consumed by millions of people everyday on
mobile, desktop and other means.
β€’ Small devices don’t have much resources, neither users
of mobile devices have much time. Slow website will
make them piss off and would make them to switch
instantly to others.
β€’ End result, loss in business, cause and other. People are
not going to listen you.
Types of Optimization
β€’ Frontend:- In which CSS, JS and at times HTML is
refactored and optimized one way or other.
β€’ Backend:- Databases; indices, queries etc. Middle tier
components.
Frontend
Performance Measuring Tools(Frontend)
β€’ WebPageTest:- This website takes an URL as input and
gives details about delays related to requests.
Performance Measuring Tools(Frontend)
β€’ Google Page Speed:- A tool by Google gives
suggestions as prescribed by Google for the input URL.
It also provides tool to minimize files and pictures.
CSS Optimization
β€’ Merge CSS files:- Instead of loading multiple CSS files,
combine all into one and then just load it. NPM tools like
concat-css can be used for the purpose. Tools like
Shrinker(http://shrinker.ch) could serve the purpose.
β€’ Minify CSS files:- Once files are merged, you can make
them further efficient by minifying them. Minifying
converts long variable and method name to a few
character words thus decrease the file size. Online
minify tools like CSSMinifier(https://cssminifier.com/) can
help here.
JS Optimization
β€’ Merge JS files:- Like CSS, you must merge multiple
files for the same purpose. The took like
JSCompress(http://jscompress.com) should help you
here.
β€’ Minify CSS files:- Once files are merged, you can make
them further efficient by minifying them. They are
minified for the same reason: to convert long
variables/function to small one hence reducing file size.
JavaScript minifer(https://javascript-minifier.com/) could
serve the purpose.
Etc…
β€’ Use CDN: - Content Delivery Networks aka CDNs is a
set of services distributed across different geographical
locations thus make loading assets faster based on the
requester’s location via IP Address. Static assets like
images, CSS or JS are usually served via CDN. CDN
services like Amazon S3 or Cloudflare could be used for
the purpose.
β€’ Reduce Web fonts usage hence they add additional
requests.
Backend
Db Optimization
β€’ Indexes:- Make sure your database tables are properly
indexed. As a rule of thumb index the fields which you
want to retrieve by using WHERE, OrderBy or GroupBy
clause.
β€’ Avoid inserts in loop(Bulk Inserts):- If you are
inserting multiple records in a loop, instead of
INSERTing in a loop, you should prepare an array kind
of data structure and then make a bulk insert. MySQL
provides such facility.
β€’ Use Where IN:- Instead of retrieving a single record you
must use whereIn(..) instead of where = <value> while
retrieving, updating or deleting records.
Db Optimization(Contd..)
β€’ Joins:- Instead of running a SELECT on a table and
then SELECT records in a loop from other table, you
should use JOIN where possible.
β€’ LIKE:- When using LIKE with multiple columns and with
OR condition, it is better to use UNION which would run
much faster.
select from users where first_name like 'ABC%'
union all select from students where last_name like
'ABC%' ;
is faster than:
select * from users where first_name like 'ABC%' or
last_name like 'ABC%' ;
Db Optimization(Contd..)
β€’ Cache:- There are often parts of the system which are
hardly updated or never updated at all. The best way to
deal with such parts is to either cache it or convert static
html of such parts. Frameworks like Laravel, Ruby and
Django provides Query and HTML cache facilities.

More Related Content

PPT
Architecture Of Large Scale Websites
PDF
Barcamp Macau 2014 - Introduction to AWS
PDF
Short introduction to Redis
PPTX
Amazon AWS & IAAS
PDF
Edge performance with in memory nosql
PPTX
Redux: server side rendering and hot code reload for single-page applications
PPTX
Sergejus Barinovas
PDF
CosmosDb for beginners
Architecture Of Large Scale Websites
Barcamp Macau 2014 - Introduction to AWS
Short introduction to Redis
Amazon AWS & IAAS
Edge performance with in memory nosql
Redux: server side rendering and hot code reload for single-page applications
Sergejus Barinovas
CosmosDb for beginners

What's hot (20)

PPT
PPTX
Couchbase
PDF
Nosql databases for the .net developer
PPTX
Kubernetes talk at DDDSydney 2017
PPTX
Cloud computing & lamp applications
PDF
Roshan Bhattarai: Scaling WordPress for high traffic sites
PPTX
Scaling wordpress for high traffic
PDF
Intro Couchdb
PPTX
Cosmosdb graph
PPT
Drupalcamp Estonia - High Performance Sites
PPTX
Road to cloud-iaas
PPTX
Benefits of Cassandra
PPT
PDF
High Performance Drupal
PPTX
Azure intoduksjon for it pro 02 data protection public
PPTX
Amazon Web Services lection 4
PDF
Simple cloud reference architecture
PPTX
MongoDB
PPTX
MySQL 101
PPTX
How to Migrate a Web App to AWS
Couchbase
Nosql databases for the .net developer
Kubernetes talk at DDDSydney 2017
Cloud computing & lamp applications
Roshan Bhattarai: Scaling WordPress for high traffic sites
Scaling wordpress for high traffic
Intro Couchdb
Cosmosdb graph
Drupalcamp Estonia - High Performance Sites
Road to cloud-iaas
Benefits of Cassandra
High Performance Drupal
Azure intoduksjon for it pro 02 data protection public
Amazon Web Services lection 4
Simple cloud reference architecture
MongoDB
MySQL 101
How to Migrate a Web App to AWS
Ad

Similar to Tips every developer should know to improve site performance (20)

PPSX
Web performance
PDF
Tips to improve your website performance
PPTX
10 Tips to make your Website lightning-fast - SMX Stockholm 2012
PPT
Website speed optimization techniques
PPTX
Website Performance
PPTX
How to Optimize Website Performance in 2025 Tips and Tools
PPTX
How to Optimize Website Performance in 2025 Tips and Tools
PDF
High Performance Websites
PPT
Frontend performance
PPTX
Front end optimization
PPT
Web performance Talk
PDF
The Need For Speed - Rigor's slides from ShopVisible Client Connect 2012
Β 
PPTX
Performace optimization (increase website speed)
PDF
A little journey into website optimization
PDF
Proven ways to improve your website performance optimizing front end and back...
PDF
Supercharge Your Site Speed 8 Optimization Tips for Better Performance.pdf
PDF
How to optimize and speed-up your website. The complete guide.
PDF
Optimization
PPTX
Best Known Website Development Hacks and Tricks to Boost Your Site's Performa...
PPTX
Best Known Website Development Hacks and Tricks to Boost Your Site's Performa...
Web performance
Tips to improve your website performance
10 Tips to make your Website lightning-fast - SMX Stockholm 2012
Website speed optimization techniques
Website Performance
How to Optimize Website Performance in 2025 Tips and Tools
How to Optimize Website Performance in 2025 Tips and Tools
High Performance Websites
Frontend performance
Front end optimization
Web performance Talk
The Need For Speed - Rigor's slides from ShopVisible Client Connect 2012
Β 
Performace optimization (increase website speed)
A little journey into website optimization
Proven ways to improve your website performance optimizing front end and back...
Supercharge Your Site Speed 8 Optimization Tips for Better Performance.pdf
How to optimize and speed-up your website. The complete guide.
Optimization
Best Known Website Development Hacks and Tricks to Boost Your Site's Performa...
Best Known Website Development Hacks and Tricks to Boost Your Site's Performa...
Ad

More from Adnan Siddiqi (6)

PPTX
Map filter reduce in Python
PPTX
Python Decorators
PPTX
Python Advance Tutorial - Advance Functions
PPTX
Exception handling in Python
PPTX
Apache cassandra
PPTX
Learning Dockers - Step by Step
Map filter reduce in Python
Python Decorators
Python Advance Tutorial - Advance Functions
Exception handling in Python
Apache cassandra
Learning Dockers - Step by Step

Recently uploaded (20)

PPTX
522797556-Unit-2-Temperature-measurement-1-1.pptx
PPTX
Introuction about WHO-FIC in ICD-10.pptx
PPTX
artificial intelligence overview of it and more
PDF
RPKI Status Update, presented by Makito Lay at IDNOG 10
Β 
PPTX
Introuction about ICD -10 and ICD-11 PPT.pptx
PDF
πŸ’° π”πŠπ“πˆ πŠπ„πŒπ„ππ€ππ†π€π πŠπˆππ„π‘πŸ’πƒ π‡π€π‘πˆ 𝐈𝐍𝐈 πŸπŸŽπŸπŸ“ πŸ’°
Β 
PDF
Testing WebRTC applications at scale.pdf
PDF
APNIC Update, presented at PHNOG 2025 by Shane Hermoso
Β 
PPTX
Introduction about ICD -10 and ICD11 on 5.8.25.pptx
PDF
SASE Traffic Flow - ZTNA Connector-1.pdf
PDF
Cloud-Scale Log Monitoring _ Datadog.pdf
DOCX
Unit-3 cyber security network security of internet system
PPTX
INTERNET------BASICS-------UPDATED PPT PRESENTATION
PPT
isotopes_sddsadsaadasdasdasdasdsa1213.ppt
PPTX
CHE NAA, , b,mn,mblblblbljb jb jlb ,j , ,C PPT.pptx
PPT
Design_with_Watersergyerge45hrbgre4top (1).ppt
PPTX
Module 1 - Cyber Law and Ethics 101.pptx
PDF
Tenda Login Guide: Access Your Router in 5 Easy Steps
PDF
The New Creative Director: How AI Tools for Social Media Content Creation Are...
PDF
Introduction to the IoT system, how the IoT system works
522797556-Unit-2-Temperature-measurement-1-1.pptx
Introuction about WHO-FIC in ICD-10.pptx
artificial intelligence overview of it and more
RPKI Status Update, presented by Makito Lay at IDNOG 10
Β 
Introuction about ICD -10 and ICD-11 PPT.pptx
πŸ’° π”πŠπ“πˆ πŠπ„πŒπ„ππ€ππ†π€π πŠπˆππ„π‘πŸ’πƒ π‡π€π‘πˆ 𝐈𝐍𝐈 πŸπŸŽπŸπŸ“ πŸ’°
Β 
Testing WebRTC applications at scale.pdf
APNIC Update, presented at PHNOG 2025 by Shane Hermoso
Β 
Introduction about ICD -10 and ICD11 on 5.8.25.pptx
SASE Traffic Flow - ZTNA Connector-1.pdf
Cloud-Scale Log Monitoring _ Datadog.pdf
Unit-3 cyber security network security of internet system
INTERNET------BASICS-------UPDATED PPT PRESENTATION
isotopes_sddsadsaadasdasdasdasdsa1213.ppt
CHE NAA, , b,mn,mblblblbljb jb jlb ,j , ,C PPT.pptx
Design_with_Watersergyerge45hrbgre4top (1).ppt
Module 1 - Cyber Law and Ethics 101.pptx
Tenda Login Guide: Access Your Router in 5 Easy Steps
The New Creative Director: How AI Tools for Social Media Content Creation Are...
Introduction to the IoT system, how the IoT system works

Tips every developer should know to improve site performance

  • 1. Site Optimization Tips for developers By Adnan Siddiqi (http://adnansiddiqi.me)
  • 2. Why Optimize? β€’ Hundreds of websites are being launched everyday which are consumed by millions of people everyday on mobile, desktop and other means. β€’ Small devices don’t have much resources, neither users of mobile devices have much time. Slow website will make them piss off and would make them to switch instantly to others. β€’ End result, loss in business, cause and other. People are not going to listen you.
  • 3. Types of Optimization β€’ Frontend:- In which CSS, JS and at times HTML is refactored and optimized one way or other. β€’ Backend:- Databases; indices, queries etc. Middle tier components.
  • 5. Performance Measuring Tools(Frontend) β€’ WebPageTest:- This website takes an URL as input and gives details about delays related to requests.
  • 6. Performance Measuring Tools(Frontend) β€’ Google Page Speed:- A tool by Google gives suggestions as prescribed by Google for the input URL. It also provides tool to minimize files and pictures.
  • 7. CSS Optimization β€’ Merge CSS files:- Instead of loading multiple CSS files, combine all into one and then just load it. NPM tools like concat-css can be used for the purpose. Tools like Shrinker(http://shrinker.ch) could serve the purpose. β€’ Minify CSS files:- Once files are merged, you can make them further efficient by minifying them. Minifying converts long variable and method name to a few character words thus decrease the file size. Online minify tools like CSSMinifier(https://cssminifier.com/) can help here.
  • 8. JS Optimization β€’ Merge JS files:- Like CSS, you must merge multiple files for the same purpose. The took like JSCompress(http://jscompress.com) should help you here. β€’ Minify CSS files:- Once files are merged, you can make them further efficient by minifying them. They are minified for the same reason: to convert long variables/function to small one hence reducing file size. JavaScript minifer(https://javascript-minifier.com/) could serve the purpose.
  • 9. Etc… β€’ Use CDN: - Content Delivery Networks aka CDNs is a set of services distributed across different geographical locations thus make loading assets faster based on the requester’s location via IP Address. Static assets like images, CSS or JS are usually served via CDN. CDN services like Amazon S3 or Cloudflare could be used for the purpose. β€’ Reduce Web fonts usage hence they add additional requests.
  • 11. Db Optimization β€’ Indexes:- Make sure your database tables are properly indexed. As a rule of thumb index the fields which you want to retrieve by using WHERE, OrderBy or GroupBy clause. β€’ Avoid inserts in loop(Bulk Inserts):- If you are inserting multiple records in a loop, instead of INSERTing in a loop, you should prepare an array kind of data structure and then make a bulk insert. MySQL provides such facility. β€’ Use Where IN:- Instead of retrieving a single record you must use whereIn(..) instead of where = <value> while retrieving, updating or deleting records.
  • 12. Db Optimization(Contd..) β€’ Joins:- Instead of running a SELECT on a table and then SELECT records in a loop from other table, you should use JOIN where possible. β€’ LIKE:- When using LIKE with multiple columns and with OR condition, it is better to use UNION which would run much faster. select from users where first_name like 'ABC%' union all select from students where last_name like 'ABC%' ; is faster than: select * from users where first_name like 'ABC%' or last_name like 'ABC%' ;
  • 13. Db Optimization(Contd..) β€’ Cache:- There are often parts of the system which are hardly updated or never updated at all. The best way to deal with such parts is to either cache it or convert static html of such parts. Frameworks like Laravel, Ruby and Django provides Query and HTML cache facilities.