> ## Documentation Index
> Fetch the complete documentation index at: https://docs.webapp.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Step Rerunning

## Why is this step rerunning?

Webapp.io uses snapshots to speed up your code in a few simple ways:

1. All processes within a VM are “snapshotted”.
2. A snapshot is taken about every 20 seconds.
3. Snapshots are marked by a banner below the accompanying step.
4. A step will be skipped if the files it uses haven't changed.

<img src="https://mintcdn.com/webappio/s6-eR6DYSUsnelQ0/resources/step_rerunning_1.png?fit=max&auto=format&n=s6-eR6DYSUsnelQ0&q=85&s=e2c7a74b3ebb563c192698971239fc51" alt="View of snapshot banner notification under the accompanying code in webapp.io" width="1278" height="196" data-path="resources/step_rerunning_1.png" />

If a snapshot is loaded, all the steps above it are skipped. This means that
costly, repetitive steps that don't read many files should be placed as high up
in the Layerfile as possible to avoid rerunning.

<img src="https://mintcdn.com/webappio/s6-eR6DYSUsnelQ0/resources/step_rerunning_2.png?fit=max&auto=format&n=s6-eR6DYSUsnelQ0&q=85&s=b4b2fdce2d4eb25aca0735790e4437ac" alt="View of how skipped steps are denoted 'skipped' and ones that are not say the duration of time that step took" width="1278" height="733" data-path="resources/step_rerunning_2.png" />

Snapshots created on a `RUN REPEATABLE` directive have a special property: the
files restored are from after the file last ran. A more detailed explanation on
[RUN REPEATABLE](/tuning-performance/run-repeatable) and a
[contrast between webapp.io and Docker's caching systems](/tuning-performance/the-layerfile-cache)
are available for further reading. Some potential inefficiencies in the use of
the layer caching system are listed below:

## Common problems with Docker

**Docker reading the entire directory**: `docker build` copies all files in the
context directory that aren't ignored by a `.dockerignore` file. Since webapp.io
tracks which files are read, this causes webapp.io to rerun if any of the files
read by Docker are changed. An easy solution is to add a
[.dockerignore file](https://docs.docker.com/engine/reference/builder/#dockerignore-file)
that stops docker from reading irrelevant files.
