Node.js template

Hi there fellow wapplers

So I started a new project in node to build a shop theme and store, theme is coming along.

But I wanted to see if I am doing things correctly. I have the main template and then my views, all works, but what confuses me is that for instance on a page a might use a modal, on another page the stripe component, but these are specific to a page, but, it adds the requirements to the template file, which as you can imagine builds upto a huge number of requests, which is a big no no for good rankings, am I doing it wrong? How would I only call store.js on my checkout, how do I only add the modal js to the one page that has a modal and so on and so forth. I like to build lean fast loading sites.

Thanks in advance

I suppose you're talking about Layout pages and content pages...

The rule I've understood from in here buddies is:
Define in a Layout page whatever is used in all content pages (that belong to this layout)
Then, whatever is needed extra in each content page you can define it directly on your content page itself.

*By the way, I would like to remind you the importance of the App ID on the pages...

There is so much nonsense around SEO you can ignore a good 80% of it. Wappler dynamic sites that use template layouts index fine even with the most complex layouts. We speak from experience.

Thanks, I tried to define the lively used item in the content page, i.e the modal but it added the requirements to the layout page, was quite surprised, is there a way to define locally, I know some day it doesn't matter, but to me to does, mobile first, lots of data used up, lots of calls, slower rendering, my php does I built in wappler are lightning fast and all page 1 Google for my target audience, and I pay a lot of attention to speed reports and optimizing as much as possible, thanks for any insight and the replies

Who are you hosting with? Maybe you need to consider changing! Our Node applications trounce our older legacy PHP applications in every regard. Sorry James I do not understand why you believe it is Node causing the issues you are speaking of? With regards to SEO we see newly created pages indexed within 24 hours, or even as quick as 6 - 8 hours for blog posts... We follow industry standard practices and do nothing special. We have our site.xml file and all tags in place within each page. Outside of that no hocus-pocus or magic tricks. Maybe consider using Flows to load the data in stages instead of in one big lump? Use caching by implementing Redis. On top stick everything behind Cloudflare for FREE and increase speed further. There are a dozen ways of improving performance. For dynamic content be efficient with your queries (don't fill them full of joins). Node nor Wappler does NOT impede the speed of content delivery. It is lightening fast and efficient. It is us as Developers who are responsible for best practices and their implementation. Wappler is not to blame for that whatsoever. I do apologise for the tone of this response if it comes across as arrogant or insulting. I do not intend that at all. It is all to easy for the workman to blame the tools. Sometimes we need to take a look at our own practices and adapt them. Especially if it is a new technology that we don't yet understand. We too went through this during our transition from PHP to Node. Now we don't look back.

1 Like

Correct, however if you use the internal link option when navigating from one content page to another, the layout is not reloaded, it simply replaces the view portion. So all the scripts load once when the first page loads, not on every content page view.

3 Likes

Hi @Cheese , tone is fone, i am not blaming node or wappler, and i never meant it to sound like that, merely i am new to node and the template setup offered by node and i was just quite suprised to see everything loaded into the layout template making that inital load quite intensive.

its not my site is slow, not at all, its actually lightening fast, but all the speed test sites still grade it a C rating due to the number of requests etc. I am still improving it with cdn and caching items etc, its early days, it was merely for me to check i was not doing anything wrong before i got too carried away.

there was also a comment about the app id, should this be the same app id on all pages, at the moment it creates a different one based on the view name.

thanks

Oh man I hate those sites... Not a fan of any of that nonsense personally. OK for a check-up to see if something is really out of order but as a reliable source... Would rather read tea leaves.

Personally in my opinion yes make all APP ID's the same. I've still absolutely no idea why they are not by default? There are countless threads within the Community of Users not being able to see their cookies, data store schemes, variables, and other items if the APP ID does not match. If they don't match you'll have to recreate these items in the page which is just time consuming and does not make any sense at all...

Sorry man I was a bit mean. Nothing personal.

Good luck with your Project James.

:slight_smile:

About APP IDs:

Concerning Server Actions, this is an inherent Wappler design "issue". The separation of front-end and back-end is a trade-off between ease of web development and performance points. I was a PHP dev too so I know where you're coming from, but I also felt the need to separate back-end and front-end because every few months or so I wanted to rebuild the back-end... So I'm not particularly annoyed at the way Wappler does stuff with Server Actions.

If you're talking about the JS scripts, I've heard the next version of Wappler will "minify"/"bundle"/"compile" assets and such before deployment. That's something I'm interested in.