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

Is cache busting supported? #2124

Closed
remarkablemark opened this issue Dec 20, 2022 · 7 comments
Closed

Is cache busting supported? #2124

remarkablemark opened this issue Dec 20, 2022 · 7 comments
Labels
enhancement Improved functionality help wanted Contributions are especially encouraged
Milestone

Comments

@remarkablemark
Copy link

remarkablemark commented Dec 20, 2022

Question

Does TypeDoc support cache busting for static assets like CSS and JS?

I have a TypeDoc site hosted on GitHub Pages: https://github.com/remarkablemark/cypress-cucumber-steps

Sometimes I notice that search is behind because assets/search.js is cached by the browser. It's only when I do a hard reload that the search is up-to-date.

I know that some other site generators append a query string with a version/hash like ?v=123 to bust the cache.

Search terms

cache, bust, static, asset, css, js

@remarkablemark remarkablemark added the question Question about functionality label Dec 20, 2022
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Dec 20, 2022

Huh, GitHub pages' cache control has always worked well for me.. no, there's no builtin way to do this today.

I'd be open to introducing an option to enable this, I don't think I want to turn it on unconditionally since a properly configured server ought not to need it, and it will mean that every file changes when regenerating the docs.

@Gerrit0 Gerrit0 added enhancement Improved functionality good first issue Easier issue for first time contributors help wanted Contributions are especially encouraged and removed question Question about functionality labels Dec 20, 2022
@remarkablemark
Copy link
Author

Gotcha, thanks for the response. I'm using Chrome so the browser cache may be pretty aggressive. For now, the hard reload works as a workaround for me.

@Gerrit0 Gerrit0 removed the good first issue Easier issue for first time contributors label Jan 7, 2023
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Jan 7, 2023

... turns out this is harder than initially anticipated, because we can't create the highlight.css file until we're done with syntax highlighting for all pages, which of course happens during rendering.

@remarkablemark
Copy link
Author

I appreciate you looking into this! I'm okay with closing this issue as won't do given the amount of effort required.

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Jan 7, 2023

I'll leave it open for a while longer - might come up with a clever way of doing things now that I can think about the issue in the background while doing other things now :)

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Mar 25, 2023

Apparently I was hung up on generating the cache query string from the file contents in January, which would be the ideal solution, but isn't strictly necessary, since it could also use the generation time, which is much simpler, though it will cause re-fetching even if nothing has changed if you rebuild the docs.

@Gerrit0 Gerrit0 added this to the v0.24 milestone Mar 25, 2023
@remarkablemark
Copy link
Author

Thanks for the update!

@Gerrit0 Gerrit0 mentioned this issue Mar 25, 2023
8 tasks
@Gerrit0 Gerrit0 closed this as completed in 929949e Apr 8, 2023
remarkablemark added a commit to remarkablemark/cypress-cucumber-steps that referenced this issue May 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improved functionality help wanted Contributions are especially encouraged
Projects
None yet
Development

No branches or pull requests

2 participants