gatsby .cache directory

Created on 12 Apr 2018  Â·  12Comments  Â·  Source: gatsbyjs/gatsby

I'm new to Gatsby and am looking for information on how the .cache directory works. I wasn't able to find any documentation. Can someone explain or post a link to how Gatsby uses it? Do I need to commit this directory into version control?

help wanted stale? documentation

Most helpful comment

Yeah, some docs on this would be great. To answer your initial question, you shouldn't commit the directory into version control.

All 12 comments

Ah, I think we don't have any document that talks about .cache directory. I'm not too familiar with how exactly it works to explain it well :smile:. But you need not add this directory to your version control system.

Yeah, some docs on this would be great. To answer your initial question, you shouldn't commit the directory into version control.

I'd also like to learn more about the .cache directory. For example, is it safe to tell TravisCI to cache this directory between builds?

One issue I've run into related to the .cache folder (in v1 at least) is gatsby build vs gatsby build --prefix-paths. It doesn't differentiate between these cases, and so, in my case when using transformer-remark the links I was expecting to point to pathPrefix-ed versions weren't actually prefixed, and only after clearing out the .cache folder and running the latter did I start seeing what I was expecting.

My .cache directory despaired while running updates, now if I run gatsby-develop it just breaks off course

So far I do not have problems with the .cache folder at the time also look for documentation about that, it would be very good that there are at least references on the website.

I checked the documentation and there are two references of .cache folder as follows
https://www.gatsbyjs.org/docs/gatsby-project-structure/ - mentions .cache shall be added to .gitignore

https://www.gatsbyjs.org/docs/webpack-and-ssr/#cache - explains more about the contents of .cache folder

I believe this completes the request in this issue and hence this issue can be closed.

I just started using Gatsby today. When I ran "gatsby develop", I got two errors. The first said "Unable to copy site files to .cache". The second said "Error: EISDIR: illegal operation on a directory, readlink..." and lists the path to the .cashe directory in my project.

My very limited understanding of EISDIR tells me the .cache directory should be a single file, but that is not consistent with the Gatsby documentation. Any recommendations on how to remedy the issue?

@bealearnscode — it sounds like node.js doesn't have permission to write to your site folder.

@KyleAMathews Thank you for the lead!

Hiya!

This issue has gone quiet. Spooky quiet. 👻

We get a lot of issues, so we currently close issues after 30 days of inactivity. It’s been at least 20 days since the last update here.

If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!

Thanks for being a part of the Gatsby community! 💪💜

Hey again!

It’s been 30 days since anything happened on this issue, so our friendly neighborhood robot (that’s me!) is going to close it.

Please keep in mind that I’m only a robot, so if I’ve closed this issue in error, I’m HUMAN_EMOTION_SORRY. Please feel free to reopen this issue or create a new one if you need anything else.

Thanks again for being part of the Gatsby community!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

magicly picture magicly  Â·  3Comments

Oppenheimer1 picture Oppenheimer1  Â·  3Comments

ghost picture ghost  Â·  3Comments

jimfilippou picture jimfilippou  Â·  3Comments

totsteps picture totsteps  Â·  3Comments