Caching results | laravel-markdown | Spatie

 SPATIE

  Laravel Markdown
===================

spatie.be/open-source

  [Docs](https://spatie.be/docs)  [Laravel-markdown](https://spatie.be/docs/laravel-markdown/v1)  Advanced-usage  Caching results

 Version   v1

 Other versions for crawler [v1](https://spatie.be/docs/laravel-markdown/v1)

- [ Introduction ](https://spatie.be/docs/laravel-markdown/v1/introduction)
- [ Support us ](https://spatie.be/docs/laravel-markdown/v1/support-us)
- [ Requirements ](https://spatie.be/docs/laravel-markdown/v1/requirements)
- [ Installation &amp; setup ](https://spatie.be/docs/laravel-markdown/v1/installation-setup)
- [ Questions and issues ](https://spatie.be/docs/laravel-markdown/v1/questions-issues)
- [ Changelog ](https://spatie.be/docs/laravel-markdown/v1/changelog)
- [ Resources and alternatives ](https://spatie.be/docs/laravel-markdown/v1/resources-and-alternatives)
- [ About us ](https://spatie.be/docs/laravel-markdown/v1/about-us)

Usage in Blade
--------------

- [ General usage ](https://spatie.be/docs/laravel-markdown/v1/usage-in-blade/general-usage)
- [ Configuring code highlighting ](https://spatie.be/docs/laravel-markdown/v1/usage-in-blade/configuring-code-highlighting)
- [ Rendering anchors ](https://spatie.be/docs/laravel-markdown/v1/usage-in-blade/rendering-anchors)
- [ Passing options to Commonmark ](https://spatie.be/docs/laravel-markdown/v1/usage-in-blade/passing-options-to-commonmark)
- [ ](https://spatie.be/docs/laravel-markdown/v1/usage-in-blade/adding-custom-attributes)

Rendering markdown
------------------

- [ General usage ](https://spatie.be/docs/laravel-markdown/v1/rendering-markdown/general-usage)
- [ Configuring code highlighting ](https://spatie.be/docs/laravel-markdown/v1/rendering-markdown/configuring-code-highlighting)
- [ Rendering anchors ](https://spatie.be/docs/laravel-markdown/v1/rendering-markdown/rendering-anchors)
- [ Passing options to Commonmark ](https://spatie.be/docs/laravel-markdown/v1/rendering-markdown/passing-options-to-commonmark)

Advanced usage
--------------

- [ Highlighting lines ](https://spatie.be/docs/laravel-markdown/v1/advanced-usage/highlighting-lines)
- [ Caching results ](https://spatie.be/docs/laravel-markdown/v1/advanced-usage/caching-results)
- [ Customizing the rendering process ](https://spatie.be/docs/laravel-markdown/v1/advanced-usage/customizing-the-rendering-process)

 Caching results
===============

Code highlighting is a resource intensive process. That's why the component ships with caching out of the box. By default, the component uses the default cache store.

To configure the store to use, or to disable caching, change the value of the `cache_store` param in the `markdown` config file. Caching is enabled by default.

Additionally, you can set the duration for how long the results are stored in the cache by setting the `cache_duration` param in the `markdown` config file. By default the results will be cached forever if caching is enabled.
