wpsharks / comet-cache

An advanced WordPress® caching plugin inspired by simplicity.
https://cometcache.com
GNU General Public License v3.0
77 stars 18 forks source link

Feature Request: Option to Select Timezone. #895

Open renzms opened 7 years ago

renzms commented 7 years ago

It would be nice if a user had the option to use the local server's timezone or had an option to select a timezone. For example, using GMT timezones since the current timezone in the plugin is only UTC.


Referencing Internal ticket: https://secure.helpscout.net/conversation/376029653/1351/

CyberCr33p commented 7 years ago

Thank you.

raamdev commented 7 years ago

What part of Comet Cache is this referring to? Comet Cache is a WordPress plugin and uses the WordPress date/time settings in Dashboard → Settings → General.

CyberCr33p commented 7 years ago

The time in the footer of the page:

Cache File Version Salt: n/a

Cache File URL: http://www.xxx.gr/ Cache File Path: /cache/comet-cache-xxx/cache/http/www-xxx-gr/index.html

Cache File Generated Via: HTTP request Cache File Generated On: Jun 9th, 2017 @ 9:22 am UTC Cache File Generated In: 1.42426 seconds

Cache File Expires On: Jun 16th, 2017 @ 9:22 am UTC Cache File Auto-Rebuild On: Jun 16th, 2017 @ 9:22 am UTC

Loaded via Cache On: Jun 9th, 2017 @ 9:24 am UTC Loaded via Cache In: 0.01759 seconds

raamdev commented 7 years ago

@CyberCr33p Ah, I see. Thank you for explaining. Yes, I agree those timestamps should follow whatever your WordPress timezone settings are set to. I'll mark this as an accepted feature request.

raamdev commented 7 years ago

@jaswrks It sounds like this might be tricky given the fact that the cache file is served before the rest of WordPress is loaded, which means we can use the usual method of retrieving the timezone info set in WordPress. Thoughts?

jaswrks commented 7 years ago

That is correct, yes. Too early to query the database. So to do this it would require saving the configured timezone and hard-coding it into the advanced-cache.php file in the form of a constant perhaps.