You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! First off, it seems that a lot of people are using your library -- congrats! Thank you for identifying it in the user-agent string.
I operate a website and, collectively, requests identifying themselves as coming from this library are starting to be a significant fraction of my bytes transferred. This is mostly because
It seems to issue requests for / on the server, which is an HTML page -- not a favicon, but ok
It doesn't support content-encoding for compressing data in flight.
Because it's fetching raw HTML so often, it's moving about 8-10x more bytes on each request than it would using accept-encoding: gzip. This is why it's come up in my analysis -- other libraries are pinging me more often, but are doing so in more efficient ways.
It's been 20 years since I did any PHP, or I'd offer a patch. From reading several related StackOverflow articles, it seems like the simplest way to send fancier HTTP requests would be to switch to using cURL instead of file_get_contents. But, I imagine there might be reasons why you don't want to do that, so, this page implies that detecting a gzipped response and applying gzdecode would suffice. Sending the accept-encodings header appears straightforward using the context mechanism that you're already using for other purposes.
Anyway, hope that's helpful.
The text was updated successfully, but these errors were encountered:
Hi! First off, it seems that a lot of people are using your library -- congrats! Thank you for identifying it in the user-agent string.
I operate a website and, collectively, requests identifying themselves as coming from this library are starting to be a significant fraction of my bytes transferred. This is mostly because
/
on the server, which is an HTML page -- not a favicon, but okcontent-encoding
for compressing data in flight.Because it's fetching raw HTML so often, it's moving about 8-10x more bytes on each request than it would using
accept-encoding: gzip
. This is why it's come up in my analysis -- other libraries are pinging me more often, but are doing so in more efficient ways.It's been 20 years since I did any PHP, or I'd offer a patch. From reading several related StackOverflow articles, it seems like the simplest way to send fancier HTTP requests would be to switch to using cURL instead of
file_get_contents
. But, I imagine there might be reasons why you don't want to do that, so, this page implies that detecting a gzipped response and applyinggzdecode
would suffice. Sending theaccept-encodings
header appears straightforward using the context mechanism that you're already using for other purposes.Anyway, hope that's helpful.
The text was updated successfully, but these errors were encountered: