Plugin Author
Baden
(@baden03)
I am sure you understand the concept of page cacheing.
When it comes to measuring the distance between two points in time, if you used a cached page, the time will be measured from when the cached page was created. This is bad if you want to know how much time is between ‘Now’ and some other point in time. Kind of important if you want to to make accurate calculations.
I do indeed understand the concept of page caching, and understand why the widget doesn’t start from the right values when the page is cached i.e. because the server passes down the time remaining (which is dependent on when the page is loaded not when it is cached) rather than the deadline (which stays the same).
However…
If you only pass the target date / time as GMT and let JS calculate how long to go, then the target date/time can be cached successfully.
Not sure I am explaining this well, so let me know if I haven’t explained it clearly enough.
Alternatively, we could use an ajax call once the page is loaded to get the current countdown value.
Plugin Author
Baden
(@baden03)
Getting the time from JS would return the time of the browser. So people located in different timezones would have different countdown values. Getting GMT time and then calculating the timezone offset of the server would be considerable more involved, and would still depend on how accurate the visitors computer time is.
The ajax call is actually a pretty good idea. We’ll take a peak into this and see get back to you.
You would have to know what time-zone they were in – which these days is reasonably reliable but not 100% certain – so that you could convert GMT deadline to local time. You would also have to convert the other way when you save the deadline.
I have connections with Joomla Fabrik folks – and their datetime plugin has to deal with the above and it is a nightmare.
So perhaps you are right and an ajax call would be better.
Plugin Author
Baden
(@baden03)
Ahoi!
We have successfully tested a solution using ajax to calculate local server time, even if the page is being cached. You are invited to download and install T(-) Countdown version 2.2.19a directly from the Plugin Oven.
Please let us know how it works for you on cached pages. If everything comes up aces, we’ll go ahead and push out an official update early next week.
Look forward to your results.
It seems to be working fine!!!!
What a speedy response to a suggestion for an enhancement!!
Plugin Author
Baden
(@baden03)
yeah, well…
..we aim to please.
so, cowboy, happy camper are we?
Still working on optimizing the caching, but so far I have halved the page load time.
So yes – I am a happy camper. 🙂
Plugin Author
Baden
(@baden03)
we’ll go ahead and mark this issue as resolved. Please consider leaving a little review on the plugin or it’s support.