Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Performance Optimizing Tips
Search
Oanh Nguyen
November 11, 2015
Programming
0
17
Performance Optimizing Tips
Some performance optimizing tips
Oanh Nguyen
November 11, 2015
Tweet
Share
More Decks by Oanh Nguyen
See All by Oanh Nguyen
Tư duy caching trong lập trình Web
oanhnn
0
350
Other Decks in Programming
See All in Programming
Kotlin Multiplatform Meetup - Compose Multiplatform 외부 의존성 아키텍처 설계부터 운영까지
wisemuji
0
120
ZJIT: The Ruby 4 JIT Compiler / Ruby Release 30th Anniversary Party
k0kubun
0
260
脳の「省エネモード」をデバッグする ~System 1(直感)と System 2(論理)の切り替え~
panda728
PRO
0
120
Developing static sites with Ruby
okuramasafumi
0
320
大規模Cloud Native環境におけるFalcoの運用
owlinux1000
0
190
モデル駆動設計をやってみようワークショップ開催報告(Modeling Forum2025) / model driven design workshop report
haru860
0
280
リリース時」テストから「デイリー実行」へ!開発マネージャが取り組んだ、レガシー自動テストのモダン化戦略
goataka
0
140
生成AIを利用するだけでなく、投資できる組織へ
pospome
2
400
Denoのセキュリティに関する仕組みの紹介 (toranoana.deno #23)
uki00a
0
150
AIエンジニアリングのご紹介 / Introduction to AI Engineering
rkaga
8
3.3k
公共交通オープンデータ × モバイルUX 複雑な運行情報を 『直感』に変換する技術
tinykitten
PRO
0
160
GISエンジニアから見たLINKSデータ
nokonoko1203
0
180
Featured
See All Featured
The Limits of Empathy - UXLibs8
cassininazir
1
190
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
100
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
110
Scaling GitHub
holman
464
140k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
90
How Software Deployment tools have changed in the past 20 years
geshan
0
30k
How to train your dragon (web standard)
notwaldorf
97
6.4k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
340
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.6k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.8k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
88
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Transcript
PERFORMANCE OPTIMIZING TIPS FOR PHP WEBSITE OanhNN & QuangNV
Content: • Web system • Web resources • How gzip
compression works • HTTP Caching • PHP performance tips • Others
Web system Database Cache DB (memcached, apc, …) Web App
(PHP, ASP, JSP, …) Web resources (css, js, img, …) Web server + HTTP Cache Web browser, App client
Web resources: • HTML (static page) • CSS • Javascript
• Images • ….
HTML • Use HTML 5: new, lightweight, … • According
to the HTML 4 DTD, you can omit the following tags. • Combine external JavaScript files • Include external CSS files before external JavaScript files
CSS • Remove unused CSS. • Using every declaration just
once means making strict use of selector grouping. • Minify CSS files.
Javascript (js) • Optimizing JavaScript code • Speeding up JavaScript:
Working with the DOM • Minify JavaScript • Compressing your JavaScript with Closure Compiler • Use Asynchronous load
Images & Web graphics • Compress images (TinyPNG) • Use
a lot of small images on big images • Use lazy load • Optimizing canvas draw
Gzip
Gzip • Browser: • Connects to server. • Notifies server
that browser supports gzip "Accept-Encoding: gzip". • Server: • Acknowledges gzip support. • Sends gzip encoded page with header "Content-Encoding: gzip". • Browser: • Receive page. • Decode gzip encoded page based on header "Content-Encoding: gzip". • Display page.
HTTP Caching
PHP performance tips • Upgrade your version of PHP •
Use caching • Use output buffering • Avoid writing naive setters and getters • Don't copy variables for no reason • Avoid doing SQL queries within a loop • Sometimes, performance of native PHP function is not best
native function vs. defined function
native function vs. defined function
Others • Using HTML 5 for performance improvements • Store
web resources on diff • Reduce the number of requests and the amount of data transferred
References • https://developers.google.com/speed/articles • https://developers.google.com/speed/articles/optimizing-i mages • http://phpmaster.com/
Q&A