background preloader

Caching Tutorial for Web Authors and Webmasters

Caching Tutorial for Web Authors and Webmasters
for Web Authors and Webmasters This is an informational document. Although technical in nature, it attempts to make the concepts involved understandable and applicable in real-world situations. Because of this, some aspects of the material are simplified or omitted, for the sake of clarity. If you are interested in the minutia of the subject, please explore the References and Further Information at the end. What’s a Web Cache? A Web cache sits between one or more Web servers (also known as origin servers) and a client or many clients, and watches requests come by, saving copies of the responses — like HTML pages, images and files (collectively known as representations) — for itself. There are two main reasons that Web caches are used: To reduce latency — Because the request is satisfied from the cache (which is closer to the client) instead of the origin server, it takes less time for it to get the representation and display it. Kinds of Web Caches Browser Caches Proxy Caches Gateway Caches

Expires Header Wie wir alle wissen kann man die größten Performanceverbesserungen auf der Browserseite erreichen. Ich habe bereits das Zusammenfassen von CSS- und Javascript-Dateien vorgestellt, ebenso wie das Zusammenfassen von Bildern in CSS-Sprites. Damit wird die Anzahl der Request schonmal reduziert. Aber es gibt natürlich noch mehr zu tun, beispielsweise die Requests noch weiter reduzieren durch gute Cache-Einstellungen, die wir an den Brower senden. Cache-Einstellungen werden via HTTP-Header an den Browser mitgesendet. Damit die unten stehenden Anweisungen vom Apache interpretiert werden können muss man das “Expires-Modul” aktivieren, häufig kann man das wie folgt erledigen: Hier die entsprechenden Apache-Einstellungen, die man entweder global im Apache einstellen kann, oder im entsprechenden vhost der Domain oder aber in der .htaccess-Datei speziell für Ordner: Mit dem Firefox-Addon Firebug kann man sich das Ergebnis anschauen:

List of PHP accelerators This is a list of PHP accelerators. Alternative PHP Cache (APC)[edit] Alternative PHP Cache is a free, open source (PHP license) framework that caches the output of the PHP bytecode compiler in shared memory, thus reducing parsing and disk I/O overhead for later requests; and a shared memory cache for user data. For an application consisting of a large source code base such as Drupal, a 3x increase in page generation speed is possible as a result.[1] It has been used at Facebook and has a mature codebase thanks to numerous contributors, including Facebook itself.[2] APC was originally scheduled for inclusion into the PHP core no later than PHP 6.[3] While multiple accelerator projects were considered desirable,[4] the focus has since moved to Optimizer Plus[5][6] which is included in the core distribution as of PHP 5.5. eAccelerator[edit] eAccelerator was born in December 2004 as a fork of the Turck MMCache project. ionCube PHP Accelerator[edit] Only supports PHP 4. Turck MMCache[edit]

Creating Your Own CMS Part 1 - Secure Login Have you ever built a site to realize it is a pain to manage? There are a lot of CMS options out there but some of them cost money, some are hard to learn, some your hosting company might not support, and well sometimes they just don’t have everything thing that you want. So today I am going to start to teach you how to create your own simple CMS. Today I will get into how you can find a design and get your secure login setup. This will be a series of blogs but to be honest I am not sure how advanced I will be going. Design of Your Own CMS This may or may not be important to you. Here is the one that I chose as well as a few others to browse through. I am creating this CMS as I type this so you guys are looking at it first hand. A Few Things To Have Before You Begin the Login If you haven’t already setup the database then you can refer to one of my recent posts “Getting Started With MySQL DB and PHP with PHPMyAdmin”. Most of this layout is pretty self-explanatory. Secure Login Code

NGINX + PHP-FPM + APC = Awesome The following guide will walk you through setting up possibly the fastest way to serve PHP known to man. If there is a faster way, I’ve not yet found it climbing through zillions of blog posts out there on the subject. In this article, we’ll be installing nginx http server, PHP with the PHP-FPM patches, as well as APC. The end result? Pure awesome. Some Background For the last 2+ years, we’ve been running Apache with mod_php at Massify . It’s a pretty well know fact by now that Nginx (pronounced engine-x, though I call it n-jinx) in typical scenarios outpaces Apache on all kinds of fronts: i/o, cpu, memory, reqs/sec. The typical nginx configuration involves using from the LightTPD project to get nginx serving up PHP. Enter PHP-FPM , which stands for PHP FastCGI Process Manager. Note: Even if you are sticking with Apache, there are a variety of reasons to skip mod_php and go straight for PHP via FastCGI. Let’s Get Rocking We’re using a fresh install of Ubuntu 8.10 Intrepid. Compile PHP #!

Eine kleine MySQL-Referenz (PHP-Tutorial) Vorwort Diese "Referenz" zeigt nur die allerwichtigsten MYSQL-Befehle. Für eine ausführlichere Referenz empfehle ich die PHP-Referenz. Viele dieser Befehle sind ähnlich den ODBC-Befehlen aufgebaut. Ist Voraussetzung in jedem PHP-Programm, das MySQL benutzen will. Mit MySQL_Connect wird meist auch gleich die Datenbank der Wahl ausgewählt; dies geht mit mysql_select_db(...) und ist deshalb hier gleich mit-erwähnt. mysql_connect('localhost') OR DIE ("Konnte nicht mit MySQL verbinden."); @mysql_select_db("datenbankname") OR DIE ("Konnte nicht mit Datenbank auf MySQL verbinden Hinweis: OR DIE (String) lässt den Programmablauf mit der Meldung String abbrechen falls das Ergebnis der vorangegangenen Operation false war. Schließt die Verbindung zu MySQL und ist am Ende jedes Programmes, das auch MYSQL_CONNECT benutzt hat, aufzurufen. mysql_close(); führt eine SQL-Anweisung aus. mysql_query ("insert into kueche values ('Messer')"); führt eine SQL-Anweisung auf Datenbank aus. siehe MYSQL_DB_QUERY-Beispiel.

Wordpress Performance Comparison: Using Nginx, Apache, APC and Varnish in Different Scenarios Wordpress Performance Comparison: Using Nginx, Apache, APC and Varnish in Different Scenarios Written by Guillermo Garron . Date: 2012-04-27 22:17:39 +0000 Introduction If you follow this blog, you may already know that I’m somehow obsessed with performance. I like to try to squeeze every drop of power from a server before upgrading it. This time, I’ve been playing with Wordpress and a Small VPS server. 512 MB RAM Shared CPU Shared Disk Arch Linux 32 Bits It is the smallest Linode available by the time of this writing. I’ve tested Wordpress on different possible configurations: Apache, PHP, MySQL Standard Apache, PHP, MySQL and APC Nginx, PHP-FPM, MySQL Nginx, PHP-FPM, MySQL and APC Nginx, PHP-FPM, MySQL, APC and Varnish Apache, PHP, MySQL, APC and Varnish I’ve used the standard Wordpress installation, with no extra plugins installed, not even Total Cache or Super Cache. Full configurations facts can be found at: Increase Wordpress performance The tests The results Apache + PHP + APC Conclusion

Using Eclipse for Web Development | corey gilmore's blog As I alluded to on Twitter, Eclipse is a horrific scattered mess of projects masquerading as an IDE. I only hear wonderful things about it, mostly from ColdFusion developers, but god help the person that assumes it will be a quick and easy installation. First you need to choose the package you want. I'm going to be writing PHP, ColdFusion, JavaScript, CSS, HTML files, and committing them to Subversion repositories. Installation Now, which package should I download? Eclipse IDE for Java EE Developers (163 MB) – Tools for Java developers creating JEE and Web applications, including a Java IDE, tools for JEE and JSF, Mylyn and othersEclipse IDE for Java Developers (85 MB) – The essential tools for any Java developer, including a Java IDE, a CVS client, XML Editor and Mylyn.Eclipse IDE for C/C++ Developers (68 MB) – An IDE for C/C++ developers with Mylyn integration. The size differences alone give me pause, and the descriptions don't help at all. Individual Package ColdFusion Duplicate Sources

A Primer on Web Caching - Thomas Hunter - Web Development Tutorials and Personal Opinions A lot of this article will apply to any network based application, but since I’m a web developer, I’m going to put a web spin on things. Also, I couldn’t help but get into compression a little while discussing browser caching. Caching is a vital part of any high traffic web app, especially ones which send a lot of data over the wire. I don’t just mean communication between the browser and the web server, but really any traffic over the local network, or even traffic between different services on the same machine. In-Memory Data Caches Storing data in memory is the fastest way to retrieve it. Disk Caches Sometimes other operations can be so slow that caching data to disk is acceptable, such as grabbing a list of recent tweets over HTTP. In general, disk caches are useful for making up for slow network requests, but using it to cache database requests probably won’t provide a lot of efficiency gain. Cache DB Results in RAM Caching DB results can be a little trick though. APC PHP File Caching

desktop applications with PHP and Titanium at SANIsoft – PHP for E Biz Welcome back! and a very Happy New Year. Yes, you saw it right. The post is about creating desktop applications with the help of PHP. And No, we are not using PHP-GTK. What is Titanium ? Titanium is a Free and open source (Uses Apache 2.0 License) framework for building native desktop and mobile applications using open web technologies (JavaScript, HTML and CSS). Now, Appcelerator Titanium (or simply Titanium) Platform consists of : 1) Titanium Desktop SDK This will be our focus in this post. 2) Titanium Mobile SDK The Titanium Mobile SDK empowers you to not just create but also run and even package real native mobile application for your favorite iOS, Android and even Blackberry (still in beta) using it cross platform JavaScript APIs and the final application will actually be a native application. Titanium Developer To create the applications using the above we need to install a tool called Titanium Developer (built using Titanium! Why would you use it. What do you need to learn ? Ready ?

Related: