0

I am using a function with loadHTML($url) to retrieve meta tags from my other site.

It works but page load times increase by 4-5 seconds.

The target pages are bit heavy, Is it possible to load just the header of remote ?

or is there any alternative ?

Arsh Dhillon
  • 101
  • 1
  • 9

2 Answers2

0

I switched to get_meta_tags http://php.net/manual/en/function.get-meta-tags.php.

It is 'bit' better now. I think the function still pull entire html but parse only till

I guess an api as suggested by "Paul Crovella" will resolve the issue completely.

Arsh Dhillon
  • 101
  • 1
  • 9
-1

Yes, you can download only headers using HEAD HTTP method instead GET. To make request i recommend use Guzzle

Grey
  • 357
  • 3
  • 12
  • meta tags are not in http headers, this is not what they're after. – user3942918 Jul 26 '17 at 03:35
  • Oh, i mean another head. Then @PaulCrovella, you can use Guzzle [streams](http://guzzle3.readthedocs.io/http-client/response.html#streaming-responses) for this case. Just abort when you find closing head tag. – Grey Jul 26 '17 at 17:19