     write_manifest(latest, digests, output_path)
   end
 
+  @comment "This is file was auto-generated by `mix phx.digest`. Remove it and all generated artefacts with `mix phx.digest.clean --all`"
+
   defp write_manifest(latest, digests, output_path) do
-    json = %{
-      "latest" => latest,
-      "version" => @manifest_version,
-      "digests" => digests
+    encoder = Phoenix.json_library()
+
+    json = """
+    {
+      "!comment!":#{encoder.encode!(@comment)},
+      "version":#{encoder.encode!(@manifest_version)},
+      "latest":#{encoder.encode!(latest)},
+      "digests":#{encoder.encode!(digests)}
     }
-
-    manifest_content = Phoenix.json_library().encode!(json)
-    File.write!(Path.join(output_path, "cache_manifest.json"), manifest_content)
+    """
+
+    File.write!(Path.join(output_path, "cache_manifest.json"), json)
   end
 
   defp remove_manifest(output_path) do

    Regex.replace(@stylesheet_url_regex, file.content, fn _, open, url, close ->
      case Regex.run(@quoted_text_regex, url) do
        [_, quote_symbol, url] ->
          open <> quote_symbol <> digested_url(url, file, latest, with_vsn?) <> quote_symbol <> close

        nil ->
          open <> digested_url(url, file, latest, with_vsn?) <> close


  defp compiled_file?(file_path) do
    compressors = Application.fetch_env!(:phoenix, :static_compressors)
    compressed_extensions = Enum.flat_map(compressors, & &1.file_extensions)

    Regex.match?(@digested_file_regex, Path.basename(file_path)) ||
      Path.extname(file_path) in compressed_extensions ||
