--- July 2016 >> Fast Forward || Life.Resume() ? ---
Long time not posted here .. since 2009, back at the time where I had zilion of things tio say .. as I did move lots of photographs during the last year to flickr, some people were asking for them so this is a real economy of time for me , thus #work : found some security issue in Magento, cleaned the server from several hacks, just finished the invoices generating module ( querying sage mssql database ) -> then generates nice printables pdf ( took me lot of Brain / Hour units ) so I'll catch up with telling my life to strangers on the web, anyways, I don't care, gotta head for the lake soon, meet some friends, take a swim, and fly away :) Besides .. some links and articles for the week : .. Small energy resume | Alptech
--- 9 layers php cache for high performance websites ---
The way of optimizing most PHP Websites are pretty simple & don't require any expensive webserver to run heavy load applications.
( quiet a long time since I haven't written anything here, becuz I've just never had the time at all ... )
The first places to look for any optimizations are obvioulsy within the mysql queries & php code : as for year 2008, this blog upon a collocation host, took more than 83 sec to generate a page as 4 users online ..
First step : implement a timer & debug functions ( as registered shutdown functions ) within your code & log them !!
Here is the 9 layers PHP cache I've setup this far :
1 : Mysql results cache & mysql inner cache & mysql indexes ****
2 : Full page html cache expires in future + binded with 304 handler ( with inner codes to invalidate data from separate block suppressed with grep upon cron ) *****
( you won't see them performing better if you put them in ram .. as the page's output will take the more time here .. that's why 304 has to be implemented here )
3 : Opcode cache ( newer php version are faster, indeed )**
4 : JSON serialized data arrays served with 304 headers whetever or not the data has been modified ( upon invalidation ) ***
5 : Array based file cache in Ram ( includes redis, memcache ) ***
6 : Individual static html files cache for individual blocks
7 : 304 headers using browser own cache ****
8 : Reverse-proxy : consider using a cdn is the same effect here
9 : Cdn : cloudflare
Then I'll demystify some legends :
- Well configured apache performs better than NGINX ( AllowOverride Off, logging static files .. )
- Amazon t2.micro instance aren't so expensive after all and are quite fast !