What is the best way to handle style that that is user-customized? Just as an example of the result I'm looking for, this would suffice:
body {
color: {{ user.profile.text_color }};
}
However, serving CSS as a view seems like it would cause a significant amount of overhead in a file that is constantly requested, so this is probably not a good solution.
The user does not have access to the CSS files and we must assume that they have no web development knowledge.
However, serving CSS as a view seems like it would cause a significant amount of overhead in a file that is constantly requested, so this is probably not a good solution.
And what if you would generate that CSS once?
/common/css.css
<link />
elements points to /user-specific/123.css?ts=123123123
. 123
is of course an identifier of the member, and ts
parameter contains a timestamp - a date of last CSS modification304 Not Modified
header - there is no need for any script execution or contents download ts
- once again just a single request is neededDo the CSS dynamically via a view as normal, but use aggressive caching so that it loads quickly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With