Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

💡 Add a cache command #21

Open
PhiloNL opened this issue Nov 21, 2021 · 1 comment
Open

💡 Add a cache command #21

PhiloNL opened this issue Nov 21, 2021 · 1 comment

Comments

@PhiloNL
Copy link
Contributor

PhiloNL commented Nov 21, 2021

I've been trying to build a cache command for Torchlight but haven't been able to wrap my head around how to approach this. If you use a post-processor, everything can be cached up front, similar to view:cache. This will eliminate on-demand requests.

Do you think this is possible with the current setup?

@stevebauman
Copy link

stevebauman commented Jan 6, 2022

Hey Philo! I was able to tackle something similar with Statamic's static site generation plugin. Not sure if this helps you any: #22

The generated HTML is cached and the torchlight API is never hit when browsing the site (I use Netlify to host).

Though the only way I can think of to make this happen via a command would be to hit/crawl every page on the app, but since users may be using a database and have dynamic routing, this would be difficult to achieve. Maybe we could accomplish this with static routes only for its first iteration (i.e. omit any routes that contain parameters)?

We could possibly leverage the same flow/architecture as Statamics static site generation...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants