greasyfork-org / greasyfork

An online repository of user scripts.
https://greasyfork.org
GNU General Public License v3.0
1.48k stars 442 forks source link

if sync url host is cdn.jsdelivr.net, autoupdate is not work #1052

Closed lisonge closed 2 years ago

lisonge commented 2 years ago

when i set sync url to https://cdn.jsdelivr.net/gh/lisonge/op-wiki-plus@main/dist/op-wiki-plus.user.js at https://greasyfork.org/zh-CN/scripts/441073-%E5%8E%9F%E7%A5%9Ewiki%E8%BE%85%E5%8A%A9%E5%B7%A5%E5%85%B7/admin

in first time, it will work

but when i upgrade version and update file https://cdn.jsdelivr.net/gh/lisonge/op-wiki-plus@main/dist/op-wiki-plus.user.js

then i click Update Settings and sync immediately at https://greasyfork.org/zh-CN/scripts/441073-%E5%8E%9F%E7%A5%9Ewiki%E8%BE%85%E5%8A%A9%E5%B7%A5%E5%85%B7/admin

but it not work, just show Script successfully synced, but no changes found.

finally i need click Close synchronization of this script and fill in the update link again, it will work

I think the reason is max-age of cdn.jsdelivr.net, Is there any other solution?

JasonBarnabe commented 2 years ago

@updateURL does nothing on Greasy Fork. It will be removed if specified.

If you are using Greasy Fork's syncing feature, then I suggest you point it to the file on GitHub rather than a CDN.

lisonge commented 2 years ago

ok, replace url with github raw url is a solution.

but i think greasyfork synchronous operations should not use cache.

and even if you use the cache, you should use the negotiation cache. because cdn.jsdelivr.net is preferred to use negotiation cache.

JasonBarnabe commented 2 years ago

They wouldn't cache client-side. There may be server-side caching though.

JasonBarnabe commented 2 years ago

As far as I can tell,

https://greasyfork.org/scripts/441073-%E5%8E%9F%E7%A5%9Ewiki%E8%BE%85%E5%8A%A9%E5%B7%A5%E5%85%B7/code/%E5%8E%9F%E7%A5%9EWiki%E8%BE%85%E5%8A%A9%E5%B7%A5%E5%85%B7.user.js https://cdn.jsdelivr.net/gh/lisonge/op-wiki-plus@main/dist/op-wiki-plus.user.js https://raw.githubusercontent.com/lisonge/op-wiki-plus/main/dist/op-wiki-plus.user.js

All have the same thing at the moment (except Greasy Fork stripped @updateURL, which is expected). So I don't see any problem here.