dot CMS

Best Practices for deploying Web Applications on dotCMS

Best Practices for deploying Web Applications on dotCMS
Marc

Marc Boutillette

Outbound Product Manager

Share this article on:

Websites in regulated industries get their heaviest traffic at the worst moments: a market-moving announcement, a service disruption, a filing or enrollment deadline. That is exactly when a slow or unavailable site does the most harm.

When a site struggles under load, the cause is rarely the servers. It is usually how the site is built and delivered: pages that are never cached, every page view running several searches, and nothing standing between the open internet and the application. dotCMS and dotCMS Cloud provide the tools to fix all of these. This checklist covers what to put in place and why it matters.

Use it before launch, before a known traffic event, and after any interruption.

1. Deliver everything through the CDN

dotCDN, the content delivery network included with dotCMS Cloud, serves your pages and files from locations close to your visitors and shields your dotCMS servers from most of the traffic.

  • Point every public domain at the CDN before launch. Visitors get cached pages from a nearby server, traffic spikes are absorbed by the CDN instead of your site, and dotCMS can adjust delivery quickly during an incident.

  • Accept public traffic only through the CDN. If your servers answer anyone who finds them, attackers and crawlers can bypass the CDN and every protection on it.

  • Block the admin login path (/dotAdmin) on your public domain. Editors don't need it on your public website, and automated attacks probe it constantly. Blocking it at the CDN shuts out password-guessing attempts and keeps that traffic off your servers.

  • Keep a separate, restricted address for testing that skips the CDN. Comparing the two is the fastest way to tell a caching problem from a content problem, which shortens troubleshooting when something goes wrong.

2. Cache pages deliberately

Caching is the biggest single factor in both speed and stability. A cached page is served in milliseconds without touching your servers; an uncached page is rebuilt from scratch on every visit.

How the layers work together. A page can be cached in three places: in dotCMS itself, on dotCDN, and in the visitor's browser. All three are controlled by one setting, the page's Cache TTL (time to live, in seconds), which you'll find in each page's properties. A Cache TTL of 3600 lets each layer keep the page for up to an hour. A Cache TTL of 0 turns off caching in all three, so every visit rebuilds the page. A Rule in dotCMS that sets a Cache-Control header overrides the page's TTL.

The Page Cache Setting

01-page-cache-ttl

When an author changes the page itself, the new version is served right away. When an author updates content shown on a page, such as an item in a news list, the change appears once that page's TTL runs out. The TTL is really the answer to "how quickly must updates appear?"

  • Give every cacheable page a Cache TTL above 0: an hour (3600) for most pages, a minute or a few minutes for fast-changing pages. Even a 60-second TTL takes almost all the load off your servers during a spike, while updates still appear within a minute.

  • Find and fix pages set to 0. A handful of busy pages at 0 can generate most of a site's load. Teams often use 0 during development and launch without changing it, and pages created by import or copy keep whatever value they started with. To see a change immediately, flush the page cache instead of setting TTL to 0.

  • Cache your 404 and error pages. Bots and broken links can generate more "not found" requests than real visits. An uncached error page turns every bad link into work for your servers.

  • Add the dotCDN purge step to your publishing workflows. It clears the CDN's copy of a page or file the moment authors publish, so long cache times never mean outdated content at the CDN.

  • Have dotCDN keep serving cached pages if your site has a problem. dotCDN can be set to keep serving the last good copy of a page while your servers recover, so residents see content instead of an error. This only works for pages that are cached.

  • Use versioned paths for files and images, and cache them for a long time. When a file's address changes with each new version, browsers and the CDN can keep it for months safely, and nobody gets a stale copy.

3. Keep each page's work small

Every page view that isn't served from cache runs your templates and their content queries. That work adds up quickly at scale.

  • Treat content searches as expensive. Content pulls and search queries are fast, but each one is roughly as costly as a database query. Fewer queries per page means faster pages and more headroom before a spike slows the site down. Count them on your busiest pages, never run them inside loops, and only request what you will display.

  • Load shared, rarely changing content once. Site settings, navigation, footers and alert banners often run their own query on every page. Cache them with dotCMS's $dotcache and #dotcache tools so they are looked up once an hour instead of on every view.

  • Cache the expensive parts of pages that can't be cached whole. Personalized pages can still cache their heavy sections, such as lists and navigation, with #dotcache, so most of the page is built once instead of on every visit.

  • Isolate outside services. If a page depends on another system, such as a payment portal, a GIS map or an outside data feed, cache its response and plan for it being unavailable. One slow outside system should not take down every page that uses it.

  • Headless sites: build pages ahead of time and cache API responses. Rendering in your front-end framework and caching dotCMS responses avoids a call to dotCMS on every visit, so pages load faster and keep working through a brief dotCMS slowdown.

4. Keep pages light

Lighter pages load faster for residents, especially on mobile connections, and have fewer things that can fail. Google's Core Web Vitals give clear targets: the main content should appear within 2.5 seconds, the page should respond to clicks within 200 milliseconds, and the layout shouldn't jump around while loading. (web.dev)

  • Serve images at the size they're displayed. The dotCMS Image API resizes and compresses images on request, including automatic WebP for browsers that support it, so phones don't download desktop-sized photos.

  • Load below-the-fold images only when needed, and reserve space for images and embeds. Pages appear faster and don't shift as they load.

  • Audit third-party scripts. Analytics, chat, translation and social widgets each add weight and each is a dependency you don't control. Remove unused ones and make sure the page still works if one fails.

  • Bundle and minify CSS and JavaScript, and limit web fonts. Fewer and smaller files mean faster first loads.

5. Control bot traffic

More than half of all web traffic is now automated, according to Imperva's 2026 Bad Bot Report, and AI crawlers are the fastest-growing share. (Imperva) An aggressive crawler can create more load than all of your residents combined.

  • Turn on dotCDN bot protection. Suspicious automated traffic is challenged at the CDN before it reaches your site. Work with dotCMS to enable it, and list the automated traffic you want allowed through: uptime monitors, testing tools, and crawlers you rely on.

  • Don't let random URL parameters bypass the cache. By default, /page?x=1 and /page?x=2 are cached separately, so a bot adding random parameters can force every request through to your servers. dotCDN and dotCMS can both be set to ignore parameters that don't change the page, such as campaign tracking tags. Keep pages that genuinely depend on parameters to a minimum.

  • Publish a robots.txt and protect expensive endpoints. Tell legitimate crawlers to skip search results and filtered listings, and limit how often site search, forms and APIs can be called. These can't be cached, so they are the easiest way for heavy traffic to overload a site.

6. Plan for failure and peaks

  • Have an emergency content path. Decide in advance how you'll publish an urgent notice, such as a small site-wide alert that on-call staff can update without a developer. In an emergency, users get accurate information fast, and the alert itself adds almost no load.

  • Test before launch and before known peaks. Load testing shows where the site will slow down before residents find out. Use realistic pages, and tell dotCMS before you test so it isn't mistaken for an attack.

  • Tell dotCMS about predictable traffic events. Product launches, regulatory deadlines and scheduled announcements are easier to prepare for together, so capacity and protections are in place before the traffic arrives.

  • Monitor from the outside. Check uptime through your public domain, and track page speed from real visitors. You'll spot slowdowns and outages before residents report them.

  • Know your top pages. Your ten most-visited pages usually carry most of the load. They should be the lightest, best-cached pages on the site.

  • Change code in a test environment first. Promote changes to production with Push Publishing instead of editing live code, so a mistake is caught before it can break the public site.

7. Consider higher-availability options

For sites with the strictest uptime or traffic requirements, dotCMS Cloud offers additional capabilities to customers in regulated industries. Your dotCMS account team can help decide which fit.

  • Multi-region resiliency. A fully independent copy of your production environment in a separate cloud region, running at the same time, so one region's outage doesn't take your site down.

  • Static publishing. Publish selected sections, or a whole site, as static files. You give up some dynamic features in exchange for the simplest, most robust delivery path.

  • Distributed caching. A shared cache across servers, so newly started servers are fast immediately instead of warming up under load.

  • Dedicated search and database resources. Capacity reserved for your environment, for sites whose search and content volume outgrow shared resources.

If you've just had an interruption

Start here. These steps are quick and have the largest effect:

  1. Confirm every public domain is served through dotCDN.

  2. Raise Cache TTLs above 0 on your most-visited pages and error pages.

  3. Ask dotCMS to enable bot protection and serving cached pages during outages.

  4. Cache shared content such as navigation, settings and alerts.

  5. Work through the rest of this checklist with your dotCMS team.

dotCMS Cloud provides the CDN, caching and infrastructure. How a site uses them decides whether it stays up when residents need it most. To review your site against this checklist, contact your dotCMS account team.

Explore dotCMS for your organization

image

dotCMS Named a Major Player

In the IDC MarketScape: Worldwide AI-Enabled Headless CMS 2025 Vendor Assessment

image

Explore an interactive tour

See how dotCMS empowers technical and content teams at compliance-led organizations.

image

Built for Compliance. Certified for AI.

dotCMS is ISO 27001 and ISO 42001 certified, pairing independently verified information security with governed, accountable AI.