APC (Alternative PHP Cache) is open source opcode caching mechanism.
I will not talk about which one is better, XCache or APC, i found out that some of them work little bit different in different environments and with different scripts. And this is probably why you did not came here to read about. We will see how to speed up some work.
Personally, i don’t like APC much but my clients do, so i needed to find out some new ways of optimizing caching to work on high load servers which also include memcached and other boys and girls.
Time To First Byte have number of components :
- DNS Lookup: Find the IP address of the domain (possible improvement: more numerous/distributed/responsive DNS servers)
- Connection time: Open a socket to the server, negotiate the connection (typical value should be around ‘ping’ time – a round trip is usually necessary – keepalive should help for subsequent requests)
- Waiting: initial processing required before first byte can be sent (his is where your improvement should be – it will be most significant for dynamic content.
We can test TTFB with ApacheBenchmark and we can see in output processing time which is sum of waiting plus complete transfer of content - if the transfer time is significantly longer than what would be expected to download the quantity of data received. further processing, after TTFB, is occuring (eg. the page is flushing content as it is available).