Archive for the 'web dev' Category
5 tips for creating high performance web apps
By Justin Silverton
The following are five tips that can help with peformance when writing php (some can be applied to other languages) applications.
1) use multi resultset queries to your database rather than many small ones
Look through your database code to see if you have requests that go to the database more than once. Each of these will decrease the number of requests per second your application can serve. By returning multiple resultsets in a single database request, you can not only cut the total time spent communicating with the database but also make your app more scalable by cutting down on the work the database server is doing to manage requests.
2) page/object caching
Templates caching (a previous article I wrote describes some template engines here)
PHP Object caching
- ion cube (commercial) - This one is unique because you don’t have to have server extensions installed.
- Alternative PHP cache (free) - will be included with PHP 6.
- Turck MMCache (free) - includes an encoder and loader, so you can distribute your scripts without the source
Database object caching
memcached - used by livejournal and slashdot.org.
3) gzip compression
Enabling this may increase CPU utilization (because it takes more processing power to gzip a file) but it will decrease the number bytes sent from you server, save your bandwidth, and generally make you site faster to your visitors.
to enable gzip compression, add the following to your php.ini:
zlib.output_compression = 1 (requires php 4.0.5 or above)
zlib.output_compression_level = X (X=0 through 7. The higher the number, the more the output will be compressed. Be careful when choosing higher numbers as it will take much more processing power) (requires PHP 4.3.0 or above)
4) tune your web server
A large list of apache (version 2.0) performance tips can be found here
5) Don’t save performance testing for the end of the project
If you save performance testing until the end of the project, it may already be too late and take too much time to make the necessary architectural changes. Tests can be performed on individual pieces of your application or the application as a whole.
10 commentsHow to upload multiple files to your website
By Justin Silverton
If you own a website of any kind and have ever wanted to allow your users to upload multiple files from a single screen, you have a few choices:
- a java applet
- an active X control
- A Flash app
- multiple file input elements (which is messy and not very efficient)
The following is a much easier way to allow multiple file uploads. Using DOM (The Document object Model), one file upload box can be created making it much easier and more user-friendly.

Installation and usage
Installation is pretty easy. The download includes sample code that you can use on your website.
All files and example of usage can be downloaded Here.
Jrotate version 3 released!
By Justin Silverton

Jrotate version 3 has been released!
Jrotate is A web photo gallery for displaying all of your favorite pictures.
- Easy Site integration
- Thumbnail support
- Multiple galleries
- 1 year free updates
This new version includes many bug fixes and updates.
A demo can be downloaded Here
No commentsHow to create an animated favicon
By Justin Silverton
What is a favicon?
A favicon (short for “favorites icon”), also known as a page icon, is an icon associated with a particular website or webpage. A web designer can create such an icon, and many graphical web browsers —such as recent versions of Internet Explorer, Firefox, Mozilla, Opera, Safari, iCab, AOL Explorer, Epiphany, Konqueror, and Flock—can then make use of them. Browsers that support favicons may display them in the browser’s URL bar, next to the site’s name in lists of bookmarks, and next to the page’s title in a tabbed document interface.
Guidelines
The following are guidelines for displaying a favicon on your website:
- The
linkelements must be inside theheadelement (between the opening and closing head tag) in the HTML. - The image can usually be in any image format supported by the web browser, the major exception being IE, which only supports ico.
- The
.icofile format will be read correctly by all browsers that can display favicons. - Use the appropriate color depths (ICO: 16X16;4, 8, 24 bpp—i.e. 16, 256 and 16 million colors GIF: use 16×16 in 256 colors PNG: use 16×16 in either 256 colors or 24-bit).
- I have found that you do not have to place html on your website. You can just place a favicon.ico in the root directory of your website, but it may take longer to show up in some browers.
Creating an animated favicon
Animated favcons are easy to create. After following the guidelines from above, you just need to create an animated gif and rename it: favicon.ico. It is currently not supported in Internet Explorer.
Examples of sites that have animated favicons:
More information on favicon can be found Here
4 commentsNew TinyMCE 2.0.2 released
What is TinyMCE?
TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source under LGPL by Moxiecode Systems AB. It has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances. TinyMCE is very easy to integrate into other CMS systems.
TinyMCE Features
Easy to integrate, takes only two lines of code.
Customizable through themes and plugins.
Customizable XHTML 1.0 output. Block invalid elements and force attributes.
International language support (Language packs)
Multiple browser support, Mozilla, MSIE, FireFox, Opera and Safari (experimental).
PHP/.NET/JSP/Coldfusion GZip compressor, Makes TinyMCE 75% smaller and a lot faster to load.
new to the release
This release adds a new cleanup routine that out performs the previous one in both performance and flexibility. This new cleanup routine is currently available in a plugin since it could include bugs and issues so we suggest using the original cleanup if you have issues with the new one.
New language packs and other contributions where also added to this release, I would like to send a big thanks to everyone contributing to this project and helping us develop one of the best WYSIWYG editor applications out there.
We also added a few new interessting options to the save plugin that enables AJAX save calls to be made.
On top of these new features we resolved lots of bugs and issues including the common one with getting xsrc/xhref attributes.
Download it Here
No comments




