Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add how to correctly get cached purged version to template source (the .json) #72

Open
LittleEndu opened this issue Dec 31, 2023 · 2 comments

Comments

@LittleEndu
Copy link
Contributor

There are many ways the script could do cache busting, but it seems sometimes it actually works against our best wishes. Real solution to this should be investigated, and if there's a way to fix it it should be added into the .json so that after loading it for the first time the script knows how to refresh it correctly.

This could also just include an incremental version number i.e filename part of the path is the cache bust not the uri query. For example templateManager is told to add https://littleendu.xyz/template.json as a source, and then in the .json templateManager would find "hey, we actually have updated this 45 times. You can find the templates in https://littleendu.xyz/template-v45.json and in the future, try https://littleendu.xyz/template-v46.json to see if we have an update"

@april83c
Copy link
Member

Regarding the version number in filename, I think the JSON should be able to specify whether this should be enabled or not (i.e. it's decided on the first time it gets the JSON)

Also, for our own templates (and HYTC): I should check what cache headers are being sent to the client — maybe I can make it not cache the JSON?

@LittleEndu
Copy link
Contributor Author

I think the JSON should be able to specify whether this should be enabled or not

That's the title part of this issue 😛

Like a new key in the .json root named version residing here:

export interface JsonParams {
contact: string | undefined
contactInfo: string | undefined // alias for contact
templates: TemplateParams[]
notifications: string | undefined // url to broadcaster
whitelist: NamedURL[]
blacklist: NamedURL[]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants