Forum Moderators: open

Message Too Old, No Replies

IF-Modified and Session User ID's

Our programmer says it can't be done.

         

HayMeadows

8:37 pm on Jul 23, 2003 (gmt 0)

10+ Year Member



The header is saying the page expired 22 years ago and it should not be cached or stored and must be revalidated. This is because the site uses PHP sessions to track the progress of each visitor. Because of that, use of the IMS header is ignored and not currently doable.

Is there anyway of working around this to Google's satisfaction? In one case the user id's are visible in the url and in another case they are not.

phpmaven

12:11 am on Jul 24, 2003 (gmt 0)

10+ Year Member



HayMeadows,

Can you be a bit more specific on exactly what you are trying to accomplish?

phpmaven

HayMeadows

12:19 am on Jul 24, 2003 (gmt 0)

10+ Year Member



On 7-21-03 GoogleGuay said:
Tip #1: Use If-Modified-Since (IMS). IMS lets your webserver tell Googlebot whether a page has changed since the last time the page was fetched. If the page hasn't changed, we can re-use the content from the last time we fetched that page. That in turn lets the bot download more pages and save bandwidth. I highly recommend that you check to see if your server is configured to support If-Modified-Since. It's an easy win for static pages, and sometimes even pages with parameters can benefit from IMS.

Trying to make Google happy! Is it possible to do the above with Session User ID tracking?

dmorison

8:03 am on Jul 24, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Haymeadows;

If-Modified-Since (if included in the request) is available to your script in the superglobal array $_GET (or $HTTP_GET_VARS).

Before your script has sent any output you can check for the "If-Modified-Since" and return 304 if appropriate:

if ($_GET["IF_MODIFIED_SINCE"] <> "")
{
if (sometest)
{
header("Status: 304 Not Modified");

exit();
}
}

Hope this helps.

sabai

2:55 am on Jul 25, 2003 (gmt 0)

10+ Year Member



my first post on this outstanding site...

dmorison:

If-Modified-Since is found in the request header, it's not a GET variable - can get it like this...


$headers = getallheaders();
$if_mod_date = $headers['If-Modified-Since'];

Haymeadows:

The header is saying the page expired 22 years ago and it should not be cached or stored and must be revalidated

He's doing this so that the pages are not cached... as long as he sets Pragma to no-cache and Cache-Control to no-cache, he shouldn't have any problems.. I think the Expires header is probably being used in this case for ancient rogue browsers that don't correctly implement Pragma and Cache-Control. I would happily ommit the Expires header, or preferably use it do display a date when the page will be out of date.

However... a great idea would be to disable session IDs for google if you can - I do this on my sites. Check for googlebot in the HTTP_USER_AGENT variable and if it is google (or another search engine) then don't start a session. There is some debate as to whether this is OK, or if it may be considred spamming by google. My justification is found on google's guidelines page:

Allow search bots to crawl your sites without session ID's or arguments that track their path through the site.

[google.com ]

hope it helps...

projectphp

7:07 am on Jul 25, 2003 (gmt 0)

10+ Year Member



NOTE: You will get better results if the questions you ask are in the right section, e.g. [webmasterworld.com...] (PHP Scripting) Although you question is asked to solve a (perceived) Google problem, the problem isn't with Google, it is a PHP problem that neeeds to be solved FOR Google. I find it always helps to look around b4 posting. Not for everyone leses sake, more for mine!

Our programmer says it can't be done.

*sigh* Programmers ALWAYS say that. A real pity that they do, as there are always solutions. They may all be too costly, but there are some. Try challenging the guy / gal. Try asking them "What are the possible alternatives? Should we stop tracking every user?"

If they still are stubborn ask "Really? No solutions AT ALL? Not one? Ok, have you posted the question on any forums? Which ones? What where your responses?"

ALWAYS challenge programmers, as they are well lazy (I am one, so I know). The last thing most want is more work.

Trying to make Google happy! Is it possible to do the above with Session User ID tracking?

IMS ONLY save bandwidth, nothing else. For Google, that is huge, but it wont hurt or help rankings at all AFAIK.

Session IDs, on the other hand, are Google's Nemesis. This is the problem that needs looking at, and there are two ways to handle it:
1. Pass it as a cookie, NEVER via the URL
2. Don't use them unless some action occurs that a spider can't perform, e.g. filling in a form.

Hope that helps.