I'm creating a single-page portfolio site using jquery scrollto and easing, etc. For ease of editing, I'm seriously considering creating each "Section" on the main page as its own template and then embedding them on one main index page. I'm concerned about the increase in load & processing by doing this. Does this seem like a good or a bad idea, all in all?
2 Answers
A few embeds never hurt anyone, despite the hype! Yes they can have a performance hit on busy or content heavy/intensive sites but for smaller sites you'd probably barely even notice, save for a few extra queries on page load.
You can always use Snippets instead of embeds if you want to segmentate your code into smaller chunks.
Saying that, as you're only running a single page, I'd still consider one template with no embeds/snippets to maximise performance to the max, so long as your code was tidy you should have no editing issues.
-
1In addition, if it's all in one page, even with all the embeds or snippets, consider just caching the entire template. That way, it saves it and doesn't have to run through all the embed processes over and over each time the page is asked for.– lealeaMar 20, 2013 at 19:41
It really depends on your site. I've built plenty of sites with embeds. Sometimes the only way to get something complex to work is with embeds. And in the case of Stash, you can even make embeds work for you.
If you don't need to pass any data between your index page and your embedded "sections," snippets will do what you want without the overhead of embeds.
Here's a comparison of the two: How to choose between an Embedded Template and a Snippet
Stash now has an embed feature that gives you a lot more control. It's like the best of snippets and embeds combined:
https://github.com/croxton/Stash#stashembed
But it's hard to say how it will impact speed without trying it out and seeing how long it takes the page to process and how many queries it uses.