Skip to Main Content
Head Rush Ajax
book

Head Rush Ajax

by Brett McLaughlin
March 2006
Beginner to intermediate content levelBeginner to intermediate
448 pages
13h 33m
English
O'Reilly Media, Inc.
Content preview from Head Rush Ajax
300
Chapter 5
Hold on a second... just because
we’re using a POST request, caching
isn’t an issue? I’d like a little more
explanation than that.
Browsers know exactly what data you’re
sending them in a GET request... all
the data is in the request URL. So when
the web browser thinks a request is the
same—because the same data is in the
URL—it tries to “help out” and return
any cached answer it has for that request.
Browsers cache GET requests
Web Browser
Internet Explorer
Firefox
Opera
Safari
Mozilla
<script>
var request...
function foo()
{
...
}
</script>
showConrmation()
Request URL
Server Response
placeOrder.php?phone=... 5
GET request
placing order
5
The browser thinks it’s helping you...
...but it ends up giving you the
same data over and over.
Even worse, the server NEVER
gets the new pizza order!
PHP script
<?php
require(‘lib.php’);
function go() {
$myVar = ...
return ...
}
?>
The request
never makes it
to the Break
Neck server.
Here’s the browser’s
caching table.
post requests aren’t cached
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Reinventing the Organization for GenAI and LLMs

Reinventing the Organization for GenAI and LLMs

Ethan Mollick
Head First Ajax

Head First Ajax

Rebecca M. Riordan

Publisher Resources

ISBN: 0596102259Errata PageSupplemental Content