How does the Accept-Encoding header interact with the Vary header when set in PHP?
When using the Accept-Encoding header in PHP, it's important to also set the Vary header to inform caching mechanisms that the response can vary based on the Accept-Encoding header. This ensures that cached responses are appropriately served based on the client's preferred encoding type.
<?php
header('Vary: Accept-Encoding');