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

custom.css file #221

Closed
juev opened this issue Apr 11, 2024 · 6 comments
Closed

custom.css file #221

juev opened this issue Apr 11, 2024 · 6 comments

Comments

@juev
Copy link

juev commented Apr 11, 2024

Hi.

I tried to make changes to the wiki styles today. I changed the static/custom.css file, after which I even restarted docker container. But I don't see any changes in the style file being used.

What could be the problem?

@bouncepaw
Copy link
Owner

Perhaps it's the browser cache?

@juev
Copy link
Author

juev commented Apr 11, 2024

Oh, you're probably right. Since I checked through curl, there are these changes in the styles.

The browser still believes that the file has not changed, and as a result does not update the cache. wiki does not have support for an E-Tag tag to indicate file updates?

@bouncepaw
Copy link
Owner

I think it doesn't have E-Tags, I don't know what they are.

@juev
Copy link
Author

juev commented Apr 11, 2024

Description link: HTTP_ETag

As another solution, this is changing the file name for styles, and possibly for all static resources, such as styles or scripts, to names containing a hash of the file contents.

It was:

<link rel="stylesheet" href="/static/style.css">

It became:

<link rel="stylesheet" href="/static/style-d587bbd6e38337f5accd.css">

Thus, when updating the contents of the file, we will receive new file names that are missing from the cache. This will allow static resources to be cached for a long time, but at the same time have up-to-date data at the front.

What do you think?

@bouncepaw
Copy link
Owner

Changing filenames looks dirty, I don't like it.

ETags seem good, I'd be glad to have them, and not just for stylesheets, but for all stuff. I get the feeling that it won't be that easy to implement it, given current chaotic Mycorrhiza codebase...

Just to be clear, I won't be implementing them any time soon, but will gladly accept a good PR. Open a new issue, maybe?

@juev
Copy link
Author

juev commented Apr 11, 2024

Ok #222

@juev juev closed this as completed Apr 11, 2024
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