yomama,
dang, yes, I do. Though probably not much help with caching .
js files.
Anyway, sometimes server-side processing takes a little time. Most people want , bang, bang, instant responses, else website slow, it sucks.
An example:
[example]
I have a backend DB(MySQL/Access/Oracle/SQLServer/DB2...), that I want users to access thu website. I'm using server-side scripting to query DB and report results. For example, wait, this is an example, very simply, go to URL:
[fake]www.qballlistproducts.com,
no,
www.qball.com/listprod.php
[/fake]
Basically list all products I sell and display html to user. I sell a LOT of crap, but we'll get there later.
Now the php script is a mixture of html and php. When a php requests 'hits' web server, will pass request to app/app server, in this case php. php and web server have an active connection until php script completes. Until php script completes, web server wants 'html' to send back to requester.
Got all this? good, me confused, lol.
Knowing this, one can take advantage of how the web server and appserver (in this case, PHP) interact. Every server-side scripting lang has an order of execution, but, let's keep simple...
Ok, almost done. The html a user sees on:
www.qball.com/listprod.php
is just a dropdownlistbox, see below...
Code:
...
<select name=products size=1>
<option value=''>Select a Product</option>
...
with ALL the products I sell. Important, I sell 1500000 products.
ANY db query to return '1500000' rows will take some time(5 sec).
I don't want user to clickey link/paste URL and wait to see webpage display nuffin until db query returns 1500000 products/rows.
What's to do?
code my php script to:
Send all html to web server thus to requesting browser, that is independent of db query, AND not dependent upon db query.
Code:
<html>
<head>
fast loading .js resources, ...
/*be careful, could bog down browser, better yet, no <script></script> tags
*/
</head>
<body>
<p><h1>Welcome to qball's imaginary product selling site!</h1></p>
<form method="POST" name="prod" action="prod_info.asp">
<p<select name=products size=1>
<option value=''>Select a Product</option>
Let's review:
user requests:
www.qball.com/listprod.php
webserver recieves request and passes on to php script
php, processes script and will return the above code snippet to web server (user recieves) BEFORE php connects to db and retrieves list of prods.
Thus user sees webpage with empty ddlb, real quick like.
THEN php, does it's stuff and returns results (formatted in html) and completes rest o' html and rest o' server request. web server happy, interaction complete.
Users been looking at empty ddlb for 5 sec, or, until php processes info form db requested.
Better than looking at nuffin/blank page/clickey STOP button.
User chooses product to buy, sees price, chooses to downlod porn instead!
[/example]
for making this up, how'd I do?
hope it helps and post back with ??s. Maybe I learn something...