diff --git a/src/kamokan/main.cpp b/src/kamokan/main.cpp index d1db81b..bb6d1f6 100644 --- a/src/kamokan/main.cpp +++ b/src/kamokan/main.cpp @@ -88,6 +88,7 @@ namespace { parSettings.add_default("highlight_css", "sh_darkness.css"); parSettings.add_default("max_post_size", "1048576"); parSettings.add_default("max_token_length", "10"); + parSettings.add_default("cache_highlighted", "true"); } void print_buildtime_info() { diff --git a/src/kamokan_impl/submit_paste_response.cpp b/src/kamokan_impl/submit_paste_response.cpp index 8eedff0..0f24efd 100644 --- a/src/kamokan_impl/submit_paste_response.cpp +++ b/src/kamokan_impl/submit_paste_response.cpp @@ -191,7 +191,8 @@ namespace kamokan { Storage::SubmissionResult submission_res = storage.submit_pastie(parText, parExpiry, parLang, parSelfDestruct, remote_ip); if (not submission_res.error) { - store_highlighted_pastie_async(submission_res.token, parText, parLang); + if (settings().as("cache_highlighted")) + store_highlighted_pastie_async(submission_res.token, parText, parLang); return std::make_pair(boost::make_optional(std::move(submission_res.token)), tawashi::HttpHeader()); }