Andrei Stanca
Andrei Stanca

Reputation: 908

checking if a web page has compression enabled with php

I want to check if a web page has gzip/deflate compression enabled with php. Probably with get_headers I won`t make it, so a anydvices, or any bit of code anywhere to check this ( couldn't find anything on the subject ). Probably I need to find in the headers for the compression, how do i make a HTTP request with compression enabled ?

Upvotes: 0

Views: 164

Answers (1)

ajreal
ajreal

Reputation: 47321

You can use curl and use curl_setopt,
set CURLOPT_ENCODING to gzip,deflate

if the webpage is gzip/deflate enabled,
the encoding request will be respect and gzip content will be returned

Upvotes: 1

Related Questions