Map Cache in GIS: How Tiles Speed Up Maps
A map cache in GIS is a pre-rendered set of map images, usually cut into square tiles at several zoom levels, that a server stores and hands out instead of drawing the map from scratch on every request. Rather than asking the GIS to render roads, labels, and symbols each time a user pans or zooms, the client simply requests the tile that covers that area, which makes web maps load far faster and puts far less load on the server.
What a Map Cache Actually Is
A cache is a stored copy of work that has already been done. In a GIS context, that work is the cartography: symbolizing layers, placing labels, applying scale-dependent visibility rules, and compositing everything into a finished picture. When you build a cache, the software renders the map once at each zoom level and slices the output into a grid of tiles, typically 256 by 256 pixels (some systems use 512). Those tiles are saved to disk or object storage with predictable file names based on their column, row, and zoom level.
The key idea is that a tile is a dumb image. It carries no attribute data, no feature geometry, and no query capability. It is a picture of the map, not the map itself. That distinction explains both why caching is so fast and why it cannot do everything a live map service can.
Why Caching Exists: The Performance Problem
Rendering a map on demand is expensive. A single request might involve reading dozens of layers from a spatial database, applying filters, running label placement algorithms that must avoid collisions, and rasterizing complex geometry. Multiply that by hundreds or thousands of concurrent users panning around, and a server spends most of its time drawing the same view over and over.
Caching inverts that cost model. The heavy rendering happens once, ahead of time, and the runtime work becomes a file lookup. The practical benefits are:
- Much faster map display, because the browser fetches small images that can also be cached locally.
- Predictable server load, since serving a static tile is cheap compared with a dynamic render.
- Consistent cartography, because labels and symbols are fixed at build time rather than shifting as the user navigates.
- Better scaling, since tiles can be pushed to a content delivery network and served from locations near users.
How Tiling and Zoom Levels Work
Tiled maps use a pyramid scheme. At zoom level 0 the whole world is a single tile. Each step up in zoom level splits every tile into four, so level 1 has 4 tiles, level 2 has 16, and so on. The count grows exponentially: by the time you reach typical street-level zooms, a global cache contains an enormous number of tiles. This is why caching is usually limited to a defined area of interest and a chosen range of zoom levels.
Each tile has a stable address derived from its position in the grid. Clients request tiles by zoom, column, and row, and the server maps that address to a file. Because the addressing scheme is standardized in web mapping conventions, tiles from one system can often be consumed by another, which is the basis of interoperability between GIS platforms and web libraries.
There are two broad cache types worth knowing:
- Raster tiles are pre-rendered images. Fast and simple, but fixed in appearance and not queryable.
- Vector tiles store geometry and attributes in a compact binary form and are styled on the client. They allow restyling without rebuilding the cache and support features like rotating labels, but they require a rendering engine on the client side.
When to Cache and When Not To
Caching is the right choice for basemaps and reference layers that change rarely and are viewed by many people: imagery, street networks, terrain, administrative boundaries, and topographic sheets. It is a poor fit when the data changes constantly or when users need to query features, since a tile cannot answer a question about what is inside it.
Ask these questions before committing to a cache:
- How often does the underlying data change? Daily edits argue against a static raster cache.
- Do users need to click features and retrieve attributes? If so, pair the cache with a separate feature service.
- What area and zoom range are actually needed? Caching the whole planet at maximum zoom is rarely justified.
- Will the map style change? Frequent restyling favors vector tiles or an on-the-fly approach.
Building and Maintaining a Cache
The general workflow is consistent across GIS platforms, though menu labels differ by product and version.
- Prepare and publish the map or service that will be cached, checking that symbology and labels look correct at every scale.
- Define the tiling scheme: the spatial reference, the tile grid, and the scale levels to generate.
- Set the area of interest, either the full extent or a drawn boundary, to avoid wasting storage.
- Choose the storage format and location, such as a tile package, a folder of images, or an object store.
- Run the cache generation job and monitor it, since large jobs can take hours or longer.
- Publish or point the map service at the completed cache and verify tiles at several zoom levels.
- Schedule updates when the source data changes, either full rebuilds or incremental updates of affected tiles.
Maintenance is the part teams underestimate. A cache is a snapshot, and it silently goes stale. If roads are added or boundaries redrawn, the cached tiles keep showing the old world until they are rebuilt. Good practice is to tie cache updates to the data update cycle and to document which cache version is live.
Common Problems and Misconceptions
A frequent misconception is that a cached map service is a full GIS service. It is not: panning and zooming work, but identify, query, and editing do not, because the client only holds images. Another common issue is missing tiles, which appear as blank squares or gray grids. This usually means the requested area or zoom level was outside the cached extent, or the generation job failed partway through.
Other recurring problems include:
- Stale content after data edits, fixed by rebuilding or updating the affected tiles.
- Blurry or oversized labels caused by generating tiles for the wrong scale range.
- Storage bloat from caching far more zoom levels than users ever reach.
- Seams between tiles from label or symbol settings that do not account for tile boundaries.
- Slow first loads when tiles are not served through a CDN or proper HTTP caching headers.
It also helps to remember that browsers and networks cache tiles too. When testing changes, clear the client cache or the browser may keep showing the old tiles even after the server has new ones.
Cache Versus Live Rendering
Live, on-the-fly rendering draws the map per request. It is flexible, always current, and supports querying, but it is slower and heavier on infrastructure. A cache is fast, cheap to serve at scale, and visually stable, but rigid and only as fresh as its last build. Many production systems use both: cached basemaps underneath, with dynamic operational layers drawn on top. That hybrid gives users a responsive background plus current, interactive data.
Frequently Asked Questions
Does a cached map service support identify or query?
No. A raster tile is an image with no attributes, so identify and query return nothing. To let users click features, publish a separate feature or map service for the same data and layer it over the cached basemap.
How often should a map cache be rebuilt?
There is no universal interval. Rebuild when the underlying data changes enough to matter to users, and prefer incremental updates of affected tiles over full rebuilds for large caches.
Why are some tiles blank or gray?
Usually the requested location or zoom level falls outside the cached extent, or the generation job did not finish. Check the cache's defined area and scale range first.
What is the difference between raster and vector tiles?
Raster tiles are pre-rendered images, fast but fixed in style. Vector tiles carry geometry and attributes and are styled on the client, so they can be restyled without rebuilding and support richer interaction.
Can I use cached tiles in a different GIS application?
Often yes, if the tiles follow a standard addressing scheme and spatial reference. Compatibility depends on the tiling scheme and how the tiles are published.