Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
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
Navigation 2 を 3 に移行する(予定)ためにやったこと
yokomii
0
300
The Past, Present, and Future of Enterprise Java with ASF in the Middle
ivargrimstad
0
140
プロポーザル駆動学習 / Proposal-Driven Learning
mackey0225
2
1.3k
Android 16 × Jetpack Composeで縦書きテキストエディタを作ろう / Vertical Text Editor with Compose on Android 16
cc4966
2
250
Deep Dive into Kotlin Flow
jmatsu
1
350
Navigating Dependency Injection with Metro
zacsweers
3
1k
250830 IaCの選定~AWS SAMのLambdaをECSに乗り換えたときの備忘録~
east_takumi
0
390
時間軸から考えるTerraformを使う理由と留意点
fufuhu
16
4.8k
個人軟體時代
ethanhuang13
0
320
ProxyによるWindow間RPC機構の構築
syumai
3
1.2k
JSONataを使ってみよう Step Functionsが楽しくなる実践テクニック #devio2025
dafujii
1
530
Compose Multiplatform × AI で作る、次世代アプリ開発支援ツールの設計と実装
thagikura
0
160
Featured
See All Featured
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
252
21k
Context Engineering - Making Every Token Count
addyosmani
3
50
Scaling GitHub
holman
463
140k
The World Runs on Bad Software
bkeepers
PRO
70
11k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
53
2.9k
Designing for Performance
lara
610
69k
It's Worth the Effort
3n
187
28k
How GitHub (no longer) Works
holman
315
140k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.1k
Thoughts on Productivity
jonyablonski
70
4.8k
[RailsConf 2023] Rails as a piece of cake
palkan
57
5.8k
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