Deleting the shared plug-in data is… scary. Even for me, I’m not sure I would recommend that. However, if you’ve not experienced any negative side effects, and it seems to be getting the results that you like i have a couple things to say:
- awesome for you. go for it.
- backup. always. especially when getting crazy with file internals.
- wow – i totally can’t believe this doesn’t just crash the hell out of stacks – i’m honestly kind of proud of myself for that kind of resilience during file loading. :-) LOL
What you’re doing, from a high level perspective, is deleting one of the places Stacks stores partial/external/template data.
Let me see if I can explain how it works, without getting too technical.
The first thing you should know is that there is NO WAY for Stacks to communicate from one page to another page in any predictable way. Pages can only communicate with each other when they are both active and loaded into memory. In a large project it’s very rare for that to happen to all your pages. In most cases, people work on a subset of their project, upload those changes, then Quit. In that normal use case, only the pages that you visit are loaded into memory – the others are all “asleep” – when they might wake up is impossible to tell.
Once you know that little detail the use of the “shared” data area might become a bit easier to guess. It’s used as a communication channel from page to page.
OK, let’s imagine a project – and see how that project communicates from page to page. I’m going to describe a pretty strange project. It’s unrealistic – but just to keep things simple enough to describe in words.
The project
Let’s imagine a medium sized project that has 26 pages named A → Z. Let’s say that on January 1st you edit page A, and then on Jan 2nd you edit page B, and so on. Each day editing one page until Jan 26 when you arrive on page Z and publish your finished site.
The partial
Now let’s imagine that on every page there is a shared partial at the bottom called “Footer”. Every page on your site utilizes this Footer partial.
The images
On each day of the month you add a new image to the footer partial. On Jan 26th there are 26 photos in the footer.
The homepage
The homepage of the site (like my example videos) is NOT a stacks page. Let’s say it’s a blog. And on each day, after adding the image, you switch to the blog and write a nice blog entry for the day, save your project and Quit RapidWeaver.
On the first day you add the first image to the Footer partial. This makes the Footer partial version 1.0.0 – then you add your blog entry, save, and quit.
In this case Footer v1.0.0 is stored inside the Page A data-file. Since you have not visited any other pages, they haven’t loaded into memory and won’t get to know about Footer v1.0.0 yet.
On the second day you open your project and it, of course, opens where you left off: the Blog page. When this happens the Stacks plug-in is barely “running”. Stacks kicks into gear when you move to page B and go to add the second image to the Footer partial.
But wait – Page B wasn’t loaded on your on Jan 1st when you added the first image and saved Footer v1.0.0 into the Page A data-file.
Now on Jan 2nd, page A is dormant and has no way to communicate to Page B. How will page B get Footer v1.0.0???
Enter: shared data
This is where the “shared data” comes in.
When you saved Footer v1.0.0 to Page A, Stacks also saves a copy of this partial to the “shared” area of your project file. When you open page B, Stacks will see that the page B copy of Footer is still back at v0.0.0 and the shared version of Footer is at v1.0.0. So Footer updates to v1.0.0 before displaying the page to you.
And so it will go on each day that the shared data will act as a conduit to transfer the Footer partial to each next page – and each page will display the correct newer version – even though each page has no way to directly talk to any other page since none are loaded on the same day.
And on the final day Jan 26th you make the final change to Footer – it’s now v26.0.0. Then you choose “Publish” and since every page has been edited, they will each need to export their data to send to your web-host. When each opens up, they will each find that the Footer v26 is the latest and will each incorporate that latest version into their page using the shared data rather than the copy of they have in their own data-file.
So when the site publishes it will have only v26 on every page. Perfect!
And it all happened without any page being able to directly talk with any other page.
Wrap-up
This, of course, is a very contrived example. In most cases there will be a few pages loaded during any session – and those pages can communicate their partial/external changes to each other and don’t need to use the shared-data as a communication conduit. So in many cases the shared-data area is completely redundant. But not always…
In many cases it is necessary and definitely will be used.
Nuking it, will nuke that communication conduit. In most cases this will not cause any side-effects – but it’s not 100% safe – and it might be very difficult to immediately see what side effects there are.
I could write for days more about this topic. There are A LOT of details I’ve left out here:
- what happens when you have a 3rd-party stack with an External?
- what happens when copy a page from one project to another?
- what happens you delete the only page containing a partial?
- what happens if delete the only copy of a partial, then save the project, then undo? can undo bring a partial back from the dead?
there are many corner cases.
but please know that in all cases stacks behaves in a conservative way to ensure data integrity.
What about the app?
Things will be quite a bit different in StacksPro (the app). For obvious reasons I’d like to keep the details of the project-file as secret as possible for as long as I can. But I’ll say what is probably obvious: site-wide project info, like partials and externals, is stored in its own special place within the project. This one simple change makes a world of difference. It makes the entire system simpler, easier to understand, and vastly more efficient.
But for many folks the first version of the app may not have 100% of the features they need to build their site – and for that we to have the Stacks Plug-In running the same Stacks5 core rendering engine inside.
This new Stacks Plug-In upgrade – that should come in the next few weeks – provides some nice new UI features, but also absolutely more important: it synchronizes the core Stacks5 rendering engine with the coming app.
That way you’ll be able to easily use both, copy and paste and drag and drop between them.
I have a ton to tell everyone about the new Stacks Plug-In upgrade that’s coming in a few weeks, and about the StacksPro app that’s coming in a few months, and about the Stacks5-Rendering Engine inside them both – but at the bottom of a thread about data-file bloat probably isn’t right. LOL 😆
Assuming I have a few big brain-dumps about the new stuff coming, what would you guys rather see:
- Blog posts?
- Forum posts? (which forum)
- A new forum?
- YouTube Video?
- Hangout/Zoom/Discord group video chat?
- Other?
If you have answer to this, please, instead of posting them here let me know on @isaiah on Twitter: https://twitter.com/isaiah – that way i’ll definitely see it and it won’t pollute this thread with other info