Welcome to WebmasterWorld Guest from 23.20.230.24

Forum Moderators: incrediBILL

Message Too Old, No Replies

hit counter slight problem

last modified date is changed

     
8:52 am on Oct 27, 2011 (gmt 0)



Morning

Right well now i have on the car clubs page a last modified date and a page hit counter both work fine or so you think the problem is the hit counter alters the last modded date , I know it is the hit counter causing the problem because i took the counter out and the date stayed correct anyone got any bright ideas on how to stop this interaction

Cheers Pete .
9:32 am on Oct 27, 2011 (gmt 0)

WebmasterWorld Senior Member penders is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



How are you getting the page last modified date? Unless you are getting the last modified date of the file you are storing the hit counter in, then they should not affect each other?!
9:47 am on Oct 27, 2011 (gmt 0)

WebmasterWorld Senior Member tangor is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



Hit counter third party? That adds new code, hence new date... A personal query: is this an online visible hit counter?

If hit count is for tracking purposes only, there are other methods to get that data without code on page (raw logs, for example)
9:49 am on Oct 27, 2011 (gmt 0)



Well the code on the page is as follows
<script type="text/javascript">
var pcs = document.lastModified.split(" ")[0].split("/");
var date = pcs[1] + '/' + pcs[0] + '/' + pcs[2];
onload = function(){
document.getElementById("lastModified").innerHTML = "Page last modified " + date;
}
</script>

with
<span class="qsr3" id="lastModified"></span>

at the foot of the page where the date displays

Pete .
11:53 am on Oct 27, 2011 (gmt 0)



Hi Tangor.

Yes this is a visable on the front page counter
4:30 pm on Oct 27, 2011 (gmt 0)

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Sorry, misinterpreted the question . . . .

document.lastModified gets it's info from the server's "Last Modified" http headers. You can see this, and if it actually sends it (some servers don't) in the FireFox extension Live HTTP Headers. If it's been working, we'll assume your server is doing that.

I know it is the hit counter causing the problem because i took the counter out and the date stayed correct


I only have one idea why removing the counter would affect this (other than above) and that is likely caching - either your browser's cache or you're browsing behind a proxy, which is in effect a cache. A cached page is a page stored in a temporary location from a previous visit; if your computer (or the proxy) doesn't recognize that the page has changed ( I.E. of course being the worst offender), it will display the cached version, giving the impression of faster web browsing. By removing the counter, you changed the overall page content, so the browser (or proxy) pulled down a fresh copy from the server and the Javascript re-executed.

You can test this: next time it happens, don't change anything. Hold the CTRL key down (or Apple key for mac) and press F5, this will force-reload the page and ignore the cache. If the date is still wrong then something else is up.
6:10 pm on Oct 27, 2011 (gmt 0)

WebmasterWorld Senior Member penders is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



Hit counter third party? That adds new code, hence new date...


If this is a static HTML page that pulls in one of those third party hit counters as an additional request then this should not affect the last modified date (which, as rocknbil says, is pulled from the HTTP response headers).

Is this a static HTML page?

If, however, this is a dynamic PHP page then the Last-Modified header is likely to be omitted (well, it is by default on the servers I'm working on) and the document.lastModified date/time could default to the value of the Date header (possibly adjusted for local time depending on browser) - which is the current server time. But that doesn't explain why removing a 'counter' would affect this.

Maybe it is a caching issue as rocknbil suggests.

What time is the lastModified property showing for when the counter is included/omitted from the page?
9:18 pm on Oct 27, 2011 (gmt 0)



Hi ..

It is a static page the only changes are when i change it and send the edit to the server , I do it all old school edit using bluefish and send the stuff up with ftp ,if i take the counter code out of the page the last modified date does not change until i send a changed page up soon as i put the counter back in the last modified changes every day regardless to there being an actual change most dang anoying
9:57 pm on Oct 27, 2011 (gmt 0)

WebmasterWorld Senior Member penders is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



What kind of counter is this?
6:42 am on Oct 28, 2011 (gmt 0)



Morning penders when you say what kind of counter is this it is a page hit counter on the front page of the car club site but where the glitch is , is that say you access the page at 23:55 then again at 00:05 not only will the hit counter increment but the page last modified date will increment as well because the hit counter changed on a date change
8:36 am on Oct 28, 2011 (gmt 0)

WebmasterWorld Senior Member penders is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



By what kind of hit counter, I mean how is it implemented? Is it called from an IMG tag, or some other kind of server-side script, ...JavaScript? Maybe if you post the code where you call the counter it might give us a clue.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month