Fix GitHub Pages CDN Caching Issue
High-Level Request
User reported that GitHub Pages were “hours out of date” despite the neural glow theme being merged and the auto-deploy fix from PR #62 being implemented.
Actions Taken
Problem Analysis
- Verified Workflow Status: Confirmed GitHub Pages workflow is running automatically since PR #62 fix
- Checked Recent Deployments: Latest neural glow theme (commit f532753) was successfully deployed at 12:04:12Z
- Identified Root Cause: Issue was CDN/browser caching, not workflow malfunction
Solution Implementation
- Added Cache Busting: Implemented timestamp-based cache busting in CSS using Jekyll’s
site.timevariable - Enhanced Workflow: Added manual dispatch trigger with “force deployment” option for immediate cache refresh
- Build Timestamping: Added build timestamps to track deployment times
- Created Documentation: Added comprehensive guide for future cache refresh procedures
Key Changes Made
# Enhanced workflow dispatch with cache refresh option
workflow_dispatch:
inputs:
force_deployment:
description: 'Force deployment to refresh cache'
required: false
default: 'false'
type: boolean
/* Cache bust: 20250906111750 */
Friction/Success Points
Success Points
- Quick Root Cause Identification: Determined that the workflow was functioning correctly and issue was caching
- Comprehensive Solution: Implemented both automatic cache-busting and manual override capabilities
- Future Prevention: Added mechanisms to prevent this issue from recurring
Lessons Learned
- CDN Caching: GitHub Pages uses aggressive CDN caching that can delay visibility of updates
- Cache-Busting Strategy: Timestamp-based cache busting in CSS ensures each deployment creates unique asset URLs
- Manual Override Value: Having a manual workflow dispatch option provides immediate recourse for urgent updates
Technical Details
The GitHub Pages auto-deploy workflow was already functioning correctly from the previous fix. The neural glow theme was successfully deployed, but CDN caching prevented users from seeing the updates. The solution adds multiple layers of cache control:
- Automatic: CSS files now include build timestamps for automatic cache busting
- Manual: Workflow can be manually triggered to force immediate deployment
- Documentation: Clear instructions for cache refresh procedures
This ensures that future theme updates will be immediately visible while maintaining the automated deployment workflow.
Morpheum