1

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?

  • Can you clarify this a little? What do you mean by "each section"? – user800 Mar 28 '13 at 21:16
4

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.

| improve this answer | |
  • 1
    In 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. – lealea Mar 20 '13 at 19:41
1

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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.