Replit ui

Thymeleaf Static Resource Caching Issues

CSS or JavaScript changes don't appear after deployment. Browser caches old versions. Users see old styles or functionality.

Aggressive caching hides code updates.

Common Causes

  1. HTTP cache headers set too long
  2. Browser aggressively caches .css/.js files
  3. No cache busting (version strings in filenames)
  4. CDN cache not invalidated
  5. Service worker caching old resources

How to Fix It

Add version query string to resources: th:href=@{/css/style.css(v=${appVersion})}. Set cache headers: Cache-Control: no-cache for HTML, public max-age=3600 for static. Use content-hash in filename (style.a1b2c3d4.css). Disable cache in development: spring.web.resources.cache.period=0.

Real developers can help you.

Mehdi Ben Haddou Mehdi Ben Haddou - Founder of Chessigma (1M+ users) & many small projects - ex Founding Engineer @Uplane (YC F25) - ex Software Engineer @Amazon and @Booking.com Simon A. Simon A. I'm a backend developer building APIs, emulators, and interactive game systems. Professionally, I've developed Java/Spring reporting solutions, managed relational and NoSQL databases, and implemented CI/CD workflows. Jen Jacobsen Jen Jacobsen I’m a Full-Stack Developer with over 10 years of experience building modern web and mobile applications. I enjoy working across the full product lifecycle — turning ideas into real, well-built products that are intuitive for users and scalable for businesses. I particularly enjoy building mobile apps, modern web platforms, and solving complex technical problems in a way that keeps systems clean, reliable, and easy to maintain. Daniel Vázquez Daniel Vázquez Software Engineer with over 10 years of experience on Startups, Government, big tech industry & consulting. Krishna Sai Kuncha Krishna Sai Kuncha Experienced Professional Full stack Developer with 8+ years of experience across react, python, js, ts, golang and react-native. Developed inhouse websearch tooling for AI before websearch was solved : ) Kingsley Omage Kingsley Omage Fullstack software engineer passionate about AI Agents, blockchain, LLMs. Stanislav Prigodich Stanislav Prigodich 15+ years building iOS and web apps at startups and enterprise companies. I want to use that experience to help builders ship real products - when something breaks, I'm here to fix it. Matthew Jordan Matthew Jordan I've been working at a large software company named Kainos for 2 years, and mainly specialise in Platform Engineering. I regularly enjoy working on software products outside of work, and I'm a huge fan of game development using Unity. I personally enjoy Python & C# in my spare time, but I also specialise in multiple different platform-related technologies from my day job. Matthew Butler Matthew Butler Systems Development Engineer @ Amazon Web Services Nam Tran Nam Tran 10 years as fullstack developer

You don't need to be technical. Just describe what's wrong and a verified developer will handle the rest.

Get Help

Frequently Asked Questions

How do I force browsers to refresh CSS?

Add query param: /css/style.css?v=1.0.1 and increment on release

Should I cache static files?

Yes, but with versioning. Use content hash for automated versioning

Related Replit Issues

Can't fix it yourself?
Real developers can help.

You don't need to be technical. Just describe what's wrong and a verified developer will handle the rest.

Get Help