SShortSingh.
Back to feed

How Three Cloudflare Cache Rules Lifted a Site's Hit Rate from 7% to 90%

0
·1 views

After deploying the static site utlkit.com to Cloudflare Pages, users in China experienced severe load times, with LCP metrics reaching up to 26 seconds at the 90th percentile. Cloudflare's cache analytics revealed a hit rate of just 7.62%, meaning nearly all requests were being served directly from origin storage, dramatically increasing latency. The root causes were Cloudflare's default behavior of not caching HTML, browser-only cache headers having limited effect on edge caching, and cookie-carrying requests triggering automatic cache bypasses. The developer resolved this by creating three targeted Cloudflare Cache Rules covering static assets with a 30-day TTL, sitemap and robots files with a 1-day TTL, and all HTML pages with a 14-day edge TTL. After applying these rules — available free within Cloudflare's three-rule limit — the cache hit rate climbed to approximately 90%, significantly improving page load performance.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Developer recreates tonkotsu ramen as interactive CSS art in a single HTML file

A developer submitted a CSS art piece depicting a tonkotsu ramen bowl for DEV Community's Frontend Challenge - Comfort Food Edition. The project is built as a single self-contained HTML file using CSS as the primary tool, with minimal JavaScript added only to randomize steam animation rhythm and enable a subtle cursor-driven parallax effect. Visual details such as the narutomaki spiral, chashu roll, and milky broth surface are rendered entirely through advanced CSS techniques including conic gradients, radial gradients, blend modes, and layered box shadows. The scene extends beyond the bowl to include a wooden table, bamboo trivet, chopsticks, and a stamped order ticket, evoking the atmosphere of a late-night ramen shop. The developer noted a stacking-context bug caused by a blend-mode layer rendering above the scene, which was resolved using isolation: isolate to contain internal blend modes correctly.

0
ProgrammingDEV Community ·

How to Safely Transfer Large ML Assets to a Server Using tar, scp, and MD5

When migrating a voice conversion app to a new server, large binary files such as precomputed features and model weights cannot be stored in a git repository due to size and manageability concerns. A practical approach involves bundling these heavy assets into a compressed tar archive, transferring them via scp, and verifying file integrity using MD5 checksums before unpacking. A carefully designed .gitignore file is essential, using broad exclusions with selective whitelisting to keep generated artifacts out of git while retaining necessary files like frontend sample audio. Key .gitignore best practices include whitelisting parent directories before individual files, anchoring exclusions to specific paths, and grouping rules with descriptive comments. This workflow ensures a clean repository, reliable file distribution, and protection against silent data corruption during network transfers.

0
ProgrammingDEV Community ·

Developer Documents First Steps Into Microservices With Service Discovery Using Eureka

A developer transitioning from monolithic architecture has begun learning microservices, sharing progress from day one of the journey. The first major concept explored was Service Discovery, studied through the Coder Ulagam tutorial channel. Using Spring Boot and Netflix Eureka, the developer set up a central Eureka Server to which individual microservices register their names and ports automatically on startup. A Home Microservice was built to communicate with a Products Microservice by resolving its location through Eureka rather than hardcoded addresses. The load-balanced RestTemplate handled inter-service calls dynamically, demonstrating how service discovery eliminates tight coupling between microservices.

0
ProgrammingDEV Community ·

Developer Releases 'Spy': A Python-Based Network Scanner Tool on GitHub

A developer has released an open-source Python project called 'Spy', a network scanning tool hosted on GitHub. The tool is capable of discovering devices on a network using ARP and performing port scans on specified targets. Results are displayed in formatted tables using the Rich Python library. The project is described as a learning exercise, with the developer actively welcoming feedback, bug reports, and suggestions from the community.

How Three Cloudflare Cache Rules Lifted a Site's Hit Rate from 7% to 90% · ShortSingh