CopyPastor

Detecting plagiarism made easy.

Score: 0.8652990559241421; Reported for: String similarity Open both answers

Possible Plagiarism

Plagiarized on 2017-03-21
by amit 1984

Original Post

Original - Posted on 2011-09-15
by Piskvor left the building



            
Present in both answers; Present only in the new answer; Present only in the old answer;

You'll need cooperation from the server-side script, but it is possible to eliminate most of the transfers using conditional requests. HTTP has a feature which allows the server to only send a response if it hasn't changed. For the PHP part, you can use e.g. this module (or reimplement the conditional logic yourself). For the AJAX part, if you use GET (as POST is non-cacheable), the response will be cached and data will only be transferred if it has changed, else it will come from the local browser cache. There are some caveats, especially if your pages are served with an Expires header
You'll need cooperation from the server-side script, but it is possible to eliminate most of the transfers using conditional requests. HTTP has a feature which allows the server to only send a response if it hasn't changed.
For the PHP part, you can use e.g. [this module][1] (or reimplement the conditional logic yourself).
For the AJAX part, if you use GET (as POST is non-cacheable), the response will be cached and data will only be transferred if it has changed, else it will come from the local browser cache.
There are some caveats, especially if your pages are served with an Expires header ([see here][2]).

[1]: http://alexandre.alapetite.fr/doc-alex/php-http-304/index.en.html#download [2]: http://blog.httpwatch.com/2009/08/07/ajax-caching-two-important-facts/

        
Present in both answers; Present only in the new answer; Present only in the old answer;