Revert "add logging for cache busting colors"

This reverts commit 43e1ea37d5.
This commit is contained in:
2025-05-27 14:43:32 +02:00
parent 43e1ea37d5
commit 17e1c4181f
3 changed files with 2 additions and 13 deletions

View File

@@ -457,7 +457,6 @@ def init_routes(main_bp):
def dynamic_colors(): def dynamic_colors():
"""Generate dynamic CSS variables based on site settings""" """Generate dynamic CSS variables based on site settings"""
logger.info(f"[Dynamic Colors] Request from: {request.referrer}") logger.info(f"[Dynamic Colors] Request from: {request.referrer}")
logger.info(f"[Dynamic Colors] Request headers: {dict(request.headers)}")
# Get colors from settings # Get colors from settings
site_settings = SiteSettings.get_settings() site_settings = SiteSettings.get_settings()
@@ -465,7 +464,6 @@ def init_routes(main_bp):
secondary_color = site_settings.secondary_color secondary_color = site_settings.secondary_color
logger.info(f"[Dynamic Colors] Current colors - Primary: {primary_color}, Secondary: {secondary_color}") logger.info(f"[Dynamic Colors] Current colors - Primary: {primary_color}, Secondary: {secondary_color}")
logger.info(f"[Dynamic Colors] Settings updated at: {site_settings.updated_at}")
# Convert hex to RGB for opacity calculations # Convert hex to RGB for opacity calculations
def hex_to_rgb(hex_color): def hex_to_rgb(hex_color):
@@ -519,10 +517,5 @@ def init_routes(main_bp):
logger.info(f"[Dynamic Colors] Generated CSS with primary color: {primary_color}") logger.info(f"[Dynamic Colors] Generated CSS with primary color: {primary_color}")
logger.info(f"[Dynamic Colors] Cache version: {site_settings.updated_at.timestamp()}") logger.info(f"[Dynamic Colors] Cache version: {site_settings.updated_at.timestamp()}")
logger.info(f"[Dynamic Colors] Response headers: {dict(response.headers)}")
response = Response(css, mimetype='text/css') return Response(css, mimetype='text/css')
response.headers['Cache-Control'] = 'no-cache, no-store, must-revalidate'
response.headers['Pragma'] = 'no-cache'
response.headers['Expires'] = '0'
return response

View File

@@ -11,9 +11,7 @@
<link href="{{ url_for('static', filename='css/file-grid.css') }}" rel="stylesheet"> <link href="{{ url_for('static', filename='css/file-grid.css') }}" rel="stylesheet">
<link href="{{ url_for('static', filename='css/base.css') }}" rel="stylesheet"> <link href="{{ url_for('static', filename='css/base.css') }}" rel="stylesheet">
<link rel="stylesheet" href="{{ url_for('static', filename='css/colors.css') }}"> <link rel="stylesheet" href="{{ url_for('static', filename='css/colors.css') }}">
<link rel="stylesheet" href="{{ url_for('main.dynamic_colors') }}?v={{ site_settings.updated_at.timestamp() }}" <link rel="stylesheet" href="{{ url_for('main.dynamic_colors') }}?v={{ site_settings.updated_at.timestamp() }}" onload="console.log('[CSS] Dynamic colors loaded with version:', '{{ site_settings.updated_at.timestamp() }}')">
onload="console.log('[CSS] Dynamic colors loaded with version:', '{{ site_settings.updated_at.timestamp() }}', 'Primary:', getComputedStyle(document.documentElement).getPropertyValue('--primary-color').trim(), 'Secondary:', getComputedStyle(document.documentElement).getPropertyValue('--secondary-color').trim())"
onerror="console.error('[CSS] Failed to load dynamic colors')">
{% block extra_css %}{% endblock %} {% block extra_css %}{% endblock %}
<script> <script>
console.log('[CSS] Base colors loaded'); console.log('[CSS] Base colors loaded');
@@ -21,8 +19,6 @@
console.log('[CSS] All CSS files loaded'); console.log('[CSS] All CSS files loaded');
console.log('[CSS] Primary color:', getComputedStyle(document.documentElement).getPropertyValue('--primary-color').trim()); console.log('[CSS] Primary color:', getComputedStyle(document.documentElement).getPropertyValue('--primary-color').trim());
console.log('[CSS] Secondary color:', getComputedStyle(document.documentElement).getPropertyValue('--secondary-color').trim()); console.log('[CSS] Secondary color:', getComputedStyle(document.documentElement).getPropertyValue('--secondary-color').trim());
console.log('[CSS] Chart color 1:', getComputedStyle(document.documentElement).getPropertyValue('--chart-color-1').trim());
console.log('[CSS] Chart color 2:', getComputedStyle(document.documentElement).getPropertyValue('--chart-color-2').trim());
}); });
</script> </script>
</head> </head>