Check whether a page is Google Cached
Posted: Tue Apr 21, 2009 9:20 am
Hi, everyone,
I want to write a small PHP script test.php that can determine whether a
webpage is Google Cached.
Assuming it is uploaded to http://www.mysite.com, and I want to use it to check
whether http://www.yoursite.com is google cached.
It works as follows:
The user input the query:
http://www.mysite.com/test.php?site=www.yoursite.com
The php script will send the following request to the browser
http://www.google.com/search?q=cache:www.yoursite.com
in the background.
And if the returned result contains a string "This is Google's cache of",
then the page is cached, so the php script can display
"Your site is cached by Google"
otherwise, it will say
"Your site is not cached by Google"
Just wonder how to implement such a feature, can anyone write a simple
sample so that I can use as a startpoint as I am a totally new guy in PHP
coding
Thanks to all of you so much
Alan
I want to write a small PHP script test.php that can determine whether a
webpage is Google Cached.
Assuming it is uploaded to http://www.mysite.com, and I want to use it to check
whether http://www.yoursite.com is google cached.
It works as follows:
The user input the query:
http://www.mysite.com/test.php?site=www.yoursite.com
The php script will send the following request to the browser
http://www.google.com/search?q=cache:www.yoursite.com
in the background.
And if the returned result contains a string "This is Google's cache of",
then the page is cached, so the php script can display
"Your site is cached by Google"
otherwise, it will say
"Your site is not cached by Google"
Just wonder how to implement such a feature, can anyone write a simple
sample so that I can use as a startpoint as I am a totally new guy in PHP
coding
Thanks to all of you so much
Alan