Closed cyfung1031 closed 9 months ago
After an update, there is a cron job that runs every minute to ensure the cached latest code is cleared on every server. If you request the code within a minute of an update, there's a good chance you will still receive an older version.
Specifically looking at the cache status of the file in your first set of screenshots, I can see that (in UTC times):
Generally, I don't think this is a problem for normal use. It's not a big deal that there is a potential one minute delay for updates, as you're dealing with hours-long delay for updates anyway due to the frequency of update checks.
If you're doing something programmatic and want to bypass the browser cache, I suggest just adding a timestamp to the URL.
Closing per above.
After an update, there is a cron job that runs every minute to ensure the cached latest code is cleared on every server.
I don't understand why you need to do it with an one-minute interval.
There are only two ways to update the script
Both will trigger the adding of @updateURL
and @downloadURL
You just need to clear the cache after the addition of @updateURL
and @downloadURL
There is no need to clear the cache for every one minute.
If you're doing something programmatic and want to bypass the browser cache, I suggest just adding a timestamp to the URL.
I tried. In the old days, I can always get the latest code using https://greasyfork.org/scripts/1-testing/code/XXXXXXX.user.js
by replacing the XXXXXXX
to a random string.
Now, I cannot find anyway, including adding a timestamp to the URL, to get the latest code after it is just updated.
Now the old url just redirect to the cached url.
@JasonBarnabe The file cache issue is still here.
After the script is JUST updated via webhook.
update.greasyfork.org
is not yet updated. (no-cache
is implemented)This is verified by the fetch API, with option
cache: 'reload'
In the DevTools, the request is sent with
Cache-Control: no-cache
The version on the Greasy Fork webpage is shown correctly with is
3.2.35
after it is just updated using webhook.However, the responded file is still the old version.
// @version 3.2.34
The
Last-Modified
also refers to the old version rather the update just now.05 Dec 2023
no-cache
control.After few minutes of the update
update.greasyfork.org
is updated. (no-cache
is implemented)cache-control
is not specified by the javascript fetch API, it will make the browser to just read the cached copy.Example Screenshot for
Status Code 200 OK (from disk cache)
After few hours
update.greasyfork.org
is updated. (with or withoutno-cache
)no-cache
or not, the latest version will be fetched.Related Issue