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
13
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
340
Other Decks in Programming
See All in Programming
GitHub Actionsで泣かないためにやっておきたい設定 / Recommended GHA settings to avoid crying
pinkumohikan
3
480
大規模Reactアプリのリアーキテクチャ~8万行のTanStack Query移行の軌跡~
kj455
3
420
Git Lint
bkuhlmann
4
740
ONE WEDGE_company_guide
1wedge_one
0
340
"config" ってなんだ? / What is "config"?
okashoi
0
210
puregoの活用例
aethiopicuschan
0
220
Front-end application development, Symfony-style(s)
dunglas
2
1.9k
Build with AI 2024 Seoul - 제로부터 시작하는 Flutter with Gemini 생활 - 박제창
itsmedreamwalker
0
200
⼤規模⾔語モデルの拡張(RAG)が 終わったかも知れない件について
nearme_tech
22
15k
TYPO3 v13 – The road to LTS: What's new and new APIs
luisasofie_xoxo
0
180
Rails と人魚の話/rails-and-mermaid
sanfrecce_osaka
0
100
Ruby Pattern Matching
bkuhlmann
0
920
Featured
See All Featured
Clear Off the Table
cherdarchuk
82
310k
Put a Button on it: Removing Barriers to Going Fast.
kastner
58
3k
The Cult of Friendly URLs
andyhume
73
5.7k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
226
16k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
225
51k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
352
28k
No one is an island. Learnings from fostering a developers community.
thoeni
14
2.1k
The Language of Interfaces
destraynor
151
23k
StorybookのUI Testing Handbookを読んだ
zakiyama
10
4.6k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
1
1.3k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
320
20k
Into the Great Unknown - MozCon
thekraken
10
980
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