• Resolved David

    (@lutchenpc)


    Can I use this plugin at two scheduled times every day? Im interested to use force refresh to clear cache of browsers using cookeies for a specific page once at 8:30am and again at 4:30pm every day. Is this possible? Specifically, is tihs possible without the need to script a cron job to make it work?

    • This topic was modified 3 years, 8 months ago by David.

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 22 total)
  • Plugin Author jordanleven

    (@jordanleven)

    Hey @lutchenpc,

    Thanks for reaching out. It’s look like you’re talking about two features here. The first is scheduling refreshes for specific times, which is not a currently supported feature but I’m always open to new features if there are enough users who would take advantage of them.

    The second feature you’re taking about is requesting a browser to clear its application cache, specifically its cookies. This is something that’s beyond this or any plug-in. Cookie invalidation would be done by the script that created the cookie, either by nullifying the contents or making the cookie expiration date in the past. There are extensive negative implications of deleting user cookies en masse (like removing analytic cookies, authentication JWTs, etc.) to the extent that I don’t see that becoming a supported feature.

    I hope that answers your questions! Let me know if you have any others!

    Thread Starter David

    (@lutchenpc)

    FYI your plugin, Force Refresh does eactly what Im saying, it triggers a 30 second timeframe clear of cache for cookie enabled connected browsers. I tested it myself after clicking refresh (pagename) button on a page it gives the 30 second pop up notification and within 30 seconds a browser I use remotely is refreshed.

    I was just hoping there was a way to run it on a schedule whether be in the plugin, run a cron job, Transients API or a string like [?cache_refresh=true] or a function such as [wp_cache_flush()] ?

    Plugin Author jordanleven

    (@jordanleven)

    Hey @lutchenpc,

    I’m not sure I understand (the link you included is just the link to the plugin). The extent to which Force Refresh has on an effect a browser is the same if a user were to simply reload the webpage. That means that if your cookies or sessions were invalidated by doing that, then your statement may be true. But the plugin itself does not invalidate or nullify cookies or sessions natively.

    • This reply was modified 3 years, 8 months ago by jordanleven.
    • This reply was modified 3 years, 8 months ago by jordanleven.
    Thread Starter David

    (@lutchenpc)

    I felt my previous reply didnt properly explain so I edited it with updates. The plugin does in fact trigger a force refresh of cookie enabled conencted browsers but was hoping by using the mentioned API, string or function I could get the plugin to be triggered during specific times.

    Thread Starter David

    (@lutchenpc)

    Basically your plugin does everything I want it to, I was just hoping a way to have it ran on scheduled times. I understand it isnt possbile natively within the plugin but I thought maybe initating plugin with a trigger I could get it to run at certain times.

    Plugin Author jordanleven

    (@jordanleven)

    Gotcha. So it sounds like your question is related exclusively to whether or not you can hook the action that sets a new site version (colloquially known as “initiating a force refresh) using something like WP Cron and not related to cookies at all (since the invalidation or nullification of those cookies would happen in their own domain space). Is that all correct?

    If I’m understanding your question correctly, I’m afraid it’s the same answer as my previous post about scheduling refreshes. This is not a currently supported feature but I’m always open to new features if there are enough users who would take advantage of them. I did have someone ask about this feature a few years ago but I like to concentrate time on adding new features and bug fixes that are more likely to be used by a majority of users (usually, I aim for at least 25% utilization for any additional feature since this is only a hobby of mine). However, since Force Refresh is open source, I welcome PRs if you’re interested in standing this feature up quicker.

    I hope I answered your questions. Let me know if there’s anything else I can help with!

    Thread Starter David

    (@lutchenpc)

    Yes, that’s exactly what I want. I want to either trigger using php, shortcode, string or whatever so I can get this plugin to run 8:30am CST and again at 4:30pm CST. Is there any way I can pm you to modify something? It does exactly what I want it to do but I cant manually click it to run twice a day every day.

    Plugin Author jordanleven

    (@jordanleven)

    Hey @lutchenpc,

    I understand. Unfortunately, that’s not currently a supported feature. However, if there’s a greater demand for this feature by other users in the future, it might be added as a core feature. Otherwise, since Force Refresh is open source, I welcome PRs if you’re up for it.

    Thread Starter David

    (@lutchenpc)

    Could I not use the wp_force_refresh function to script a php file for a cron job?

    Plugin Author jordanleven

    (@jordanleven)

    I believe wp_force_refresh is a static constant that’s used to generate cryptographic nonces, not a function (unless you’re talking about something different). The functions that are responsible for updating the page/site versions are under includes/api/admin/, although to refresh them, it does require authentication from a valid nonce.

    In any case, I think you’re asking if you can use private APIs to manually trigger them from a script. Since this project is open source, the private APIs are no secret. However, private APIs in this and all plugins are volatile and subject to change. Meaning that if they changed in the future, they could have implications on your implementation.

    Thread Starter David

    (@lutchenpc)

    Alright, so that doesn’t work. It was worth a shot. Argh! That’s too bad. It’s the perfect cache plugin and would love and would pay for a premium version to get it to run on a cron or ideally, have it in the plugin.

    Plugin Author jordanleven

    (@jordanleven)

    Hey @lutchenpc,

    Thanks for understanding. If this feature is ever natively supported (either as a public API or end-user feature) I’ll try to remember to let you know via this thread.

    I’m looking for a similar feature.

    Our site needs to force refresh for everyone at a specific date and time – in my case though the refresh doesn’t need to repeat until rescheduled.

    Dates/times would be scheduled hours or days in advance by an intermediate-level WordPress user.

    Thanks for the plugin!

    Plugin Author jordanleven

    (@jordanleven)

    Thanks @ruanna! Although this feature isn’t currently supported, I’ll try to remember to respond to this thread if it’s ever added to a release.

    That’d be great, thank you so much @jordanleven

Viewing 15 replies - 1 through 15 (of 22 total)
  • The topic ‘Daily Schedule’ is closed to new replies.