Skip to content

Move all inline style to dedicated endpoint #2877

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

Merged
merged 2 commits into from
Feb 23, 2025

Conversation

vmcj
Copy link
Member

@vmcj vmcj commented Dec 8, 2024

We rendered the <style> within the which is not valid. By moving it to a dedicated endpoint we also save a bit of bandwith as this is content which stays static during the contest.

#[Route(path: '/dynamic-css', name: 'get_dynamic_css')]
public function dynamicCSS(): Response {
$response = new Response();
$response->headers->set('Content-Type', 'text/css');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should maybe set some expire headers? Otherwise browsers won't cache it.
Drawback is that it will change once the colors change, so maybe use an etag header instead?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We discussed and I'll try to implement a cache and keep the etag there.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if the current implementation is not already enough, we save on the bandwidth but still need to calculate the "whole" page (as we did before).

@vmcj vmcj force-pushed the webstandard_cleanup branch from a0f9cd3 to fed305a Compare December 24, 2024 22:50
@vmcj vmcj force-pushed the webstandard_cleanup branch 2 times, most recently from 771d0a7 to 255d7db Compare February 23, 2025 15:03
@vmcj vmcj force-pushed the webstandard_cleanup branch from 255d7db to d0e3037 Compare February 23, 2025 15:59
@vmcj vmcj requested a review from nickygerritsen February 23, 2025 16:21
We rendered the <style> within the <body> which is not valid. By moving
it to a dedicated endpoint we also save a bit of bandwith as this is
content which stays static during the contest.
@vmcj vmcj force-pushed the webstandard_cleanup branch from d0e3037 to a5da764 Compare February 23, 2025 21:56
@vmcj vmcj enabled auto-merge February 23, 2025 21:56
@vmcj vmcj added this pull request to the merge queue Feb 23, 2025
Merged via the queue into DOMjudge:main with commit e982562 Feb 23, 2025
35 checks passed
@vmcj vmcj deleted the webstandard_cleanup branch February 23, 2025 22:30
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

Successfully merging this pull request may close these issues.

2 participants