The Difference between Static and Dynamic Web Pages
Understanding static vs. dynamic web pages
Whenever you incorporate a dynamic application server into a web site, it's important to understand how the process works. First, let's talk about how static web sites operate. A static web site is a collection of web pages, Cascading Style Sheet files, image files, and other related assets. All of these assets are stored on a server and then delivered to web clients such as browsers, using a kind of software called an HTTP server.
There are number of popular HTTP servers on the market, but the two most common are Internet Information Services, or IIS, a free web server that's included with the Windows Operating System, and Apache, a free open source HTTP server product which is used on pretty much all operating systems, including Windows, Linux, Mac OS X, and other flavors of UNIX. With static web sites, a client, such as a web browser stored on a personal computer or a mobile device, sends an HTTP request.
HTTP stands for Hypertext Transfer Protocol. The format of the request is in a URL, which stands for Uniform Resource Locator. A URL could be http://www.lynda.com. That would mean that the request is going to the default directory on lynda.com's web site. The server receives this request and then figures out what it means. The request typically points to a particular file on the server's disk.
The server retrieves the file, opens it up, gets its content, and sends that content back to the client as an HTTP response. Here is a little diagram that shows how it works. The client sends the request to the server. The request is in the form of the URL. The server finds the file and sends its content back to the client. So that's a static web site. When you mix in an application server, your web site becomes dynamic.
The application server software, such as PHP, ColdFusion, or ASP, is installed on the same physical computer, typically, as the HTTP server software. The client, that is the web browser, once again sends an HTTP request, formatted as a URL. The client doesn't know that there is an application server involved. The request looks exactly the same to the web browser, regardless of whether the web site is dynamic or static.
The HTTP server software receives this request, but instead of responding to it directly, as it does with a static web site, it dispatches the request to the application server. It knows how to do this by looking at the file extension in the URL. If the file extension is .cfm, that's a request for the ColdFusion Server. .asp would be for Active Server Pages, .aspx for ASP.NET and .php for the PHP application server.
The Application Server works with server-side resources, such as databases, XML files. and other content, and then dynamically constructs an HTTP response. which is sent back to the client. Once again, here is a diagram that shows how it works. The client sends the request to the server, formatted as a URL, the HTTP server receives the request, and now dispatches it to the Application Server, the Application Server might work with the database on the server to get some content.
The data is returned to the Application Server. The Application Server constructs an HTTP response, returns that to the HTTP server; and the HTTP server returns the content to the client. Once again, the important thing here is that the client doesn't know an application server is involved; its relationship is directly to the HTTP server. So that's how dynamic web sites differ from static web sites. Once you involve an application server, such as PHP, your HTTP response, typically in the form of HTML, or Hypertext Markup Language, is constructed dynamically by the application server, instead of stored statically in a document on the HTTP server's hard disk.
WordPress DIY: Community Website65,882 Views
Code Clinic: Ruby79,780 Views
Squarespace 7 Intermediate Techniques42,207 Views
Making Music with Ableton Push120,343 Views
Adobe Color Essential Training20,085 Views
PHP with MySQL Essential Training4,271,059 Views
Illustrator CC 2013 One-on-One: Fundamentals1,677,422 Views
PHP with MySQL Beyond the Basics2,281,782 Views