gray-matter icon indicating copy to clipboard operation
gray-matter copied to clipboard

No mention of cache

Open buckle2000 opened this issue 5 years ago • 2 comments
trafficstars

There is a part of my code that looks like this:

doc = matter()
doc.content = render(doc.content)

Took awhile to figure out it returns the same object. I don't think gray-matter should keep the object it returns.

buckle2000 avatar Apr 09 '20 20:04 buckle2000

this thread helped: https://github.com/jonschlinkert/gray-matter/issues/43#issuecomment-318258919

Passing in empty options object disables caching. This is especially noticeable with many test files containing the same content.

Would, minimally, a PR for the docs be helpful, or a change to make cache keys unique?

jdedwards3 avatar Dec 12 '20 20:12 jdedwards3

I just lost several hours due to this. If there is any caching at all it should be clearly stated in the readme.

SystemParadox avatar Aug 21 '21 16:08 SystemParadox