CDN for PHP
PHP should run application code, not static files.
Classic PHP origins still serve assets and identical HTML from the same workers that run application logic. Global traffic makes that painful quickly.
Cache static files at Cloud CDN. Cache anonymous PHP GET output where it is safe. Bypass admin, sessions and POST. Use Origin Shield on misses.
Why teams use Aptranet
What CDN for PHP looks like on this network.
Cloud CDN caches and accelerates eligible content on 210+ points of presence, with Origin Shield when the origin must stay out of the way.
Assets off PHP-FPM
CSS, JS, fonts and images are served from 210+ PoPs.
Anonymous PHP from cache
Public pages that do not vary on session can be stored at the edge.
Origin Shield in front of PHP
Duplicate misses are consolidated before they reach the origin.
How to set it up
A cutover you can validate before DNS moves.
Create the Cloud CDN configuration, prove it on an Aptranet hostname, then point production DNS when the path looks correct.
- 1Put the document root behind Cloud CDN
Pull the PHP origin over HTTPS.
- 2Cache static extensions first
Start with css, js, images and fonts, then consider HTML.
- 3Bypass admin and POST
Do not cache login, dashboards or form posts.
- 4Enable Origin Shield
Protect PHP-FPM from thundering herds after TTL expiry.
Outcomes
What changes once the hostname is on Aptranet.
- Static files never need PHP
- Anonymous pages can be cached
- Origin Shield protects workers
- Admin remains dynamic
Keep reading
Related pages
More CDN use cases on the same Cloud CDN footprint.
Frequently Asked Questions
Yes. Those are PHP origins. See the dedicated WordPress and Laravel pages for framework-specific notes.
Bypass cache when the response depends on a session cookie.
Cloud CDN caches the HTTP response. FastCGI remains an origin detail.
Use a production origin such as nginx + PHP-FPM, not the built-in server.
