Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Delicious Brains Blog:
Microcaching WordPress in Nginx to Improve Server Requests by 2,400%
Apr 26, 2017 @ 10:18:40

The Delicious Brains has a new tutorial posted sharing a method you can use to setup microcaching in Nginx for your WordPress installation and improve the performance of server requests by a large margin.

We’ve talked a lot about WordPress performance and hosting WordPress here at Delicious Brains. A common theme amongst those articles is the importance of page caching and how it’s arguably the best way to improve the performance of your WordPress site. [...] However, we’ve also alluded to the fact that page caching is difficult to implement on highly dynamic sites.

[...] In these circumstances page caching still has its place but the duration of the cache has to be significantly reduced. This is known as microcaching. Microcaching is a technique where content is cached for a very short period of time, usually in the range of 1-10 seconds. In this article, I’m going to demonstrate how to configure WordPress and bbPress with Nginx FastCGI caching.

They start off with some initial benchmarks performed using the Blitz.io service against a clean WordPress install on a Digital Ocean droplet. The first results are of a test with 100 concurrent users over 60 seconds (with not so great results). Then, using this method in the Nginx configuration, the site is retested resulting in much better performance but with one downfall - the pages are cached and no longer dynamic.

To resolve this they move to the "microcaching" solution, adding the caching to parts of the application that aren't the forum using the "X-Accel-Expires" header sent from WordPress. The post ends with a bit more tweaking to the configuration and some caveats to its use.

tagged: wordpress caching microcaching nginx tutorial dyanmic benchmark

Link: https://deliciousbrains.com/microcaching-wordpress-nginx-improve-server-requests-2400/

Custom Scripts Blog:
Dynamic layouts in Twig
Dec 18, 2013 @ 12:18:14

On the Custom Scripts blog they've shared a new tutorial showing you how to use the popular PHP templating tool Twig to create dyanmic layouts for your application.

Recently I worked on a project that needed dynamic layouts for each bundle. The idea was to have a base template, then several layout templates that each extends from the base. Each view would then extend from one of the layout files.

In the scenario I had, I needed to allow each bundle to specify there own stylesheets and javascripts. So each bundle needed to create a custom layout that overrides the parent stylesheet and javascript block adding their own content, and I did not want to re-create the layout files for each bundle.

He's created a base template for the entire site leaving areas for stylesheet and javascript injection as well as making it flexible enough to accept multiple column layouts. Layered on top of this is a base template for each bundle that's then extended via a custom extension class as needed. The PHP is also included to define this and the other extension classes you'll need to make the setup work.

tagged: twig template dyanmic tutorial

Link: http://blog.customscripts.co.za/dynamic-layouts-twig/

LotsOfCode.com:
Tag Cloud Tutorial
Sep 06, 2007 @ 08:57:00

In this tutorial on the LotsOfCode website, the author looks to help you create a feature common to several (including this one) websites out there - a tag cloud.

In this tutorial i am going to show you how to create a basic word / tag cloud using php. I am going to create a class based cloud, this is because it will be more convenient for people to adapt it on there own websites, if you don't know much about class based programming then click here to take a look at the class tutorial.

They pull the information from their "words array" (where words can be dynamically added to it) and use a percentage rating to base the CSS size for the data's span tag. The entire class listing is provided in one big chunk to make copy and paste easy.

tagged: tag cloud tutorial dyanmic css size class method tag cloud tutorial dyanmic css size class method

Link:

LotsOfCode.com:
Tag Cloud Tutorial
Sep 06, 2007 @ 08:57:00

In this tutorial on the LotsOfCode website, the author looks to help you create a feature common to several (including this one) websites out there - a tag cloud.

In this tutorial i am going to show you how to create a basic word / tag cloud using php. I am going to create a class based cloud, this is because it will be more convenient for people to adapt it on there own websites, if you don't know much about class based programming then click here to take a look at the class tutorial.

They pull the information from their "words array" (where words can be dynamically added to it) and use a percentage rating to base the CSS size for the data's span tag. The entire class listing is provided in one big chunk to make copy and paste easy.

tagged: tag cloud tutorial dyanmic css size class method tag cloud tutorial dyanmic css size class method

Link:

Icemelon.com:
Dynamic Images in PHP (with GD)
Dec 27, 2005 @ 12:08:48

In this post from digg.com today, there's a pointer to this tutorial from Icemelon.com today about creating dynamic images in PHP.

If you frequent forums, you'd probably remember images in people's signatures that would display information about your computer. Such mysticism! This tutorial will teach you that, and more!

They show you step by step how to use the GD extension in PHP to update a pre-existing image (a PNG in this case) with the viewer's IP address dynamically. It's just a small bit of what you can do with GD, but it's a good introduction to what it looks like...

tagged: tutorial dyanmic images gd png tutorial dyanmic images gd png

Link:

Icemelon.com:
Dynamic Images in PHP (with GD)
Dec 27, 2005 @ 12:08:48

In this post from digg.com today, there's a pointer to this tutorial from Icemelon.com today about creating dynamic images in PHP.

If you frequent forums, you'd probably remember images in people's signatures that would display information about your computer. Such mysticism! This tutorial will teach you that, and more!

They show you step by step how to use the GD extension in PHP to update a pre-existing image (a PNG in this case) with the viewer's IP address dynamically. It's just a small bit of what you can do with GD, but it's a good introduction to what it looks like...

tagged: tutorial dyanmic images gd png tutorial dyanmic images gd png

Link: