Possible Duplicate:
What's the shebang (#!) in Facebook and new Twitter URLs for?
Why there are more and more websites (for example twitter or gawker) using '#!' instead of '?' to separate parameters from the rest of URL? What are the advantages?
It is becoming a standard way, proposed by Google, of making AJAX web applications crawlable.
'?' is used to separate the path component of the URL from the query component. When a browser requests such a resource, both components are sent to the web server. The server can look at the query and determine what response to send back.
'#' is used differently -- it separates the 'fragment' or 'hash' component from the rest of the url. The fragment component is never sent to the web server, but it is available to any scripts running in the page.
Comparing two URLs, say
http://www.example.com/service/?my+query
and
http://www.example.com/service/#!my+query
In the first case, the whole url is sent to the server, and a response is returned. Any caches along the way, from the browser all the way to the server, will see the query string, and know that the response is only relevant to that query. They may cache the response for that query, but more likely will not cache the response at all.
With this scheme, this means that if example.com is a popular service, they will have to send a full response to every single user of the service, and it is very likely that none of their results will be cached anywhere.
In the second case, only the path component, http://www.example.com/service/
is used, and the server will (likely) return the same document to every user requesting that URL. Upstream caches will be able to cache that document, and serve it to new users without going back to the origin web server for every request.
With this scheme, there will probably be some JavaScript running on that document which looks at the fragment, and then requests any additional search results from the service. These could be much smaller than an entire page, reducing the load on the server, or they could be cacheable results, available to multiple users.
The specific form, '#!', is an emerging standard for AJAX-style web applications, so that their URLs can be indexed by search engines, or analyzed by web-analytics software. The actual URL spec only mandates the '#' character, and it can be used for other purposes as well (like named anchors within a document).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With