<?php if (! ($loader = @include __DIR__ . '/../vendor/autoload.php')) { die(<<<EOT You need to install the project dependencies using Composer: $ wget http://getcomposer.org/composer.phar OR $ curl -s https://getcomposer.org/installer | php $ php composer.phar install --dev $ phpunit EOT ); } $loader->add('Negotiation\Tests', __DIR__);
Content negotiation technology usually has three implementation schemes:
(1) Client driver
The client initiates a request, the server sends a list of options, and after the client makes a selection, it sends the Second request.
Advantages: relatively easy to implement
Disadvantages: increased delay, at least two requests must be sent, the first request to obtain the resource list, and the second request to obtain the selected copy.
(2) Server driver
The server checks the client's request header set and decides which version of the page to provide.
Advantages: Faster than client-driven negotiation. HTTP provides a q mechanism that allows the server to approximate matching, and also provides a vary header for the server to tell downstream devices (such as proxy servers) how to evaluate the request.
Disadvantages: The header set does not match, the server has to make guesses
(3) Transparent negotiation
An intermediate device (usually a cache proxy) negotiates on behalf of the client
Advantages: Eliminates the negotiation overhead of the web server and is faster than client-driven negotiation.
Disadvantages: HTTP does not provide corresponding specifications
All resources on this site are contributed by netizens or reprinted by major download sites. Please check the integrity of the software yourself! All resources on this site are for learning reference only. Please do not use them for commercial purposes. Otherwise, you will be responsible for all consequences! If there is any infringement, please contact us to delete it. Contact information: admin@php.cn
Related Article
09Nov2024
Distinguishing "Memcache" and "Memcached" in PHPPHP offers two memcached libraries: memcache and memcached. Understanding their differences helps...
13Dec2024
Linking Static Libraries to Other Static Libraries: A Comprehensive ApproachStatic libraries provide a convenient mechanism to package reusable...
19Nov2024
Memcache vs Memcached: Choosing the Right PHP Memcached LibraryIntroductionPHP offers two seemingly similar memcached libraries: memcache and...
18Nov2024
PHP Email Address Validation Libraries UncoveredEmail address validation plays a crucial role in data validation, but creating a...
06Jul2016
I have seen many open source projects in the form of class.classname.php, but I have also seen many frameworks in the form of classname.class.php. Where should I place this class? I personally prefer the .class.php form, because in some frameworks, after importing third-party class libraries and specifying class libraries...
12Nov2024
Memcache vs. Memcached: Choosing the Right PHP Library for Your Cache NeedsIn the realm of PHP caching libraries, Memcache and Memcached stand out...
Hot Tools
PHP library for dependency injection containers
PHP library for dependency injection containers
A collection of 50 excellent classic PHP algorithms
Classic PHP algorithm, learn excellent ideas and expand your thinking
Small PHP library for optimizing images
Small PHP library for optimizing images