PHP APC - make your app super fast!

One of the many advantages of using Ubuntu over windows is the ability to install and test out all the plug-ins available for PHP. One of them being APC (Alternative PHP Cache).

I just upgraded to the latest Ubuntu 10.10 and figured I would take a quick screen shot, for anyone that is doubting how much something like APC can affect an application. When I first found out about them, I did not think the effects would be so large. This is just a clean install of PHP and MySql from Ubuntu's 'apt-get install' command. I have not done any extra tweaking after installing APC, just a simple restart of Apache.

  

As you can see memory usage is half, and the request time is 2/3's what it was. And this was just by typing 2 commands into a shell. 'sudo apt-get install php-apc' and 'sudo service apache2 restart'. About 30 seconds out your day and save your self hours on waiting for pages to load.

Simply put, APC works by caching the compiled PHP source code and saving it in memory. This saves the server from having to read code off the disc and compiling the code for each and every request. Having the compiled code served from memory saves a lot of time by limiting slow disk reads for PHP files.

When using APC with CakePHP you do not need to use the APC cache settings to see these gains as the big speed comes from caching the compiled code. What the CakePHP APC config will do is save your cached data to memory instead of the files it uses by default, again saving on disk reads.

Read more...

Removing the www sub domain from your url

For the most part, the www in a domain is pretty pointless. In general it's only there to make you type 4 extra characters to get to the site you want. It can also cause you a lot of pain trying to develop Ajax applications as I once found out.

There I was tying to get some Ajax working on a client site I was busy with only to be given some error about cross domain Ajax being disabled or not a…

Read more...

Using other apps with CakePHP - htaccess config

One thing that is asked quite a lot on #cakephp is how to use other apps alongside CakePHP, and the answer giving is normally pretty ugly. Stick the files/folders in side webroot/. Although that does work, its not very nice. So ill show you a little trick with .htaccess files.

The first (really simple way) is to use a .htaccess inside the sub folder. For example you can have a copy of Joomla! …

Read more...

Time for a new layout with the new Infinitas

So the Windows 3.1 was not working for you? Even though there was mixed reactions, I thought it was pretty cool. So I scraped a bit of time together and started work on a new layout. Ill be sticking with this one for a while, although I will most likely be tweaking it as time goes on.

If you are using internet-shitty, tough luck. I'm using a lot of css3 and html5 and as time goes on there will…

Read more...

Progress

Infinitas has seen some huge changes in the structure, if you been following the development you would have noticed. Besides removing a lot of code (about 50k lines or so) much of the code has new homes. With all the development going on some plug-ins were getting a bit full of unrelated code and it was decided that everything should be split up.

The new structure has a lot to do with the core…

Read more...

No more posts