Search…

X3 Photo Gallery Support Forums

Search…
 
User avatar
gaitt
Experienced
Topic Author
Posts: 46
Joined: 21 Nov 2010, 12:48

What does X3 at first load?

08 Aug 2015, 08:35

Hey Karl,

I have 6 large well filled mega menu in my gallery, I notice that all the information are stored in every html file.
In a technical point of view, I have no clue if it good or bad, but can it slow down the gallery?

An other question, when editing the gallery with the panel and checking the gallery just after, it takes 3-5s to load. And when I check what is going on, I see my 2 cores of my server CPU at full load with apache 2 doing stuff. How can I optimize here?

Also, I have written a "blog" post and I wasn't able to put a image into a grid. I manage to do it put with some standard html.
Code
<ul class='small-block-grid-1 medium-block-grid-2 large-block-grid-4'>
  <li>Block grids give you a way to evenly split contents of a list within the grid.</li>
  <li>![image](http://image_url)</li>
  <li>It will collapse to 2 items on each row for medium screens (tablet), and 1 item on each row for small screens.</li>
  <li>Read more about the block grid <a href=http://foundation.zurb.com/docs/components/block_grid.html>here</a></li>
  <li>Item 5</li>
  <li>Item 6</li>
  <li>Item 7</li>
  <li>Item 8</li>
</ul>
Looking forward to the RC :D
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13998
Joined: 30 Sep 2006, 03:37

Re: What does X3 at first load?

09 Aug 2015, 02:15

gaitt wrote:I have 6 large well filled mega menu in my gallery, I notice that all the information are stored in every html file.
In a technical point of view, I have no clue if it good or bad, but can it slow down the gallery?
It's a good question ... but I am curious: How are you checking that the menu is stored in every html file? That is correct, but even if we loaded the menu via javascript in JSON format, it would still get "injected" into the html, but dynamically from the client.

Other than that, yes it can slow down the website before pages get cached. When X3 generates a page, it has to loop through all folders to create the menu, which is probably the heaviest X3 server task. Once a page gets cached, it should be irrelevant because the page is stored as a html file inside the app cache folder.

Normally when a visitor visits your pages, he will load the page with menu only once, because consecutive page clicks only load a JSON file that contains page data, EXCLUDING the menu. However, each of your pages will likely get created at some point on server as visitors arrive directly on them, and of course there are bots also that may force a full page creation.

We are working on some concepts so that the menu doesn't need to get created separately for each and every page. Either we will load the menu via javascript/json on page load, or we may just keep it like now, but make sure each page grabs a "cached" copy of the menu instead of having to recreate it.

Technical talk ... ;)
gaitt wrote:An other question, when editing the gallery with the panel and checking the gallery just after, it takes 3-5s to load. And when I check what is going on, I see my 2 cores of my server CPU at full load with apache 2 doing stuff.
Yep, this is when X3 needs to recreate pages after you changed something from the panel. If you have a heavy folder structure, this will definitely be the main reason why it takes 3-5 seconds. The question is though, do you have the preload option enabled? This would definitely be the reason why your server spends time ... You should disable it when you are editing.
gaitt wrote:How can I optimize here?
As long as preload is disabled, you can't really optimize much. In my opinion, cache is one of the wonderful features of X3, but the process of creating the menu has to happen at some point after editing. Once you refresh the page once, every visitor will see the cached version ... With a relatively heavy folder structure, you need to live with the "page processing time" after editing pages.
gaitt wrote:Also, I have written a "blog" post and I wasn't able to put a image into a grid. I manage to do it put with some standard html.
Code
<ul class='small-block-grid-1 medium-block-grid-2 large-block-grid-4'>
  <li>Block grids give you a way to evenly split contents of a list within the grid.</li>
  <li>![image](http://image_url)</li>
  <li>It will collapse to 2 items on each row for medium screens (tablet), and 1 item on each row for small screens.</li>
  <li>Read more about the block grid <a href=http://foundation.zurb.com/docs/components/block_grid.html>here</a></li>
  <li>Item 5</li>
  <li>Item 6</li>
  <li>Item 7</li>
  <li>Item 8</li>
</ul>
Not quite sure what you are trying to do. You just want a custom grid with a custom image? ... or are you trying to add the blog preview image like for example in the mjau-mjau blog posts? https://mjau-mjau.com/blog/ajax-universal-analytics/
 
User avatar
gaitt
Experienced
Topic Author
Posts: 46
Joined: 21 Nov 2010, 12:48

Re: What does X3 at first load?

10 Aug 2015, 04:36

mjau-mjau wrote: It's a good question ... but I am curious: How are you checking that the menu is stored in every html file? That is correct, but even if we loaded the menu via javascript in JSON format, it would still get "injected" into the html, but dynamically from the client.
Ctrl+U in Chrome to show html source code.
mjau-mjau wrote:Other than that, yes it can slow down the website before pages get cached. When X3 generates a page, it has to loop through all folders to create the menu, which is probably the heaviest X3 server task. Once a page gets cached, it should be irrelevant because the page is stored as a html file inside the app cache folder.

Normally when a visitor visits your pages, he will load the page with menu only once, because consecutive page clicks only load a JSON file that contains page data, EXCLUDING the menu. However, each of your pages will likely get created at some point on server as visitors arrive directly on them, and of course there are bots also that may force a full page creation.
Ok, but when you talk about the cached html file, does this cache system is activated when the preload is at false?
mjau-mjau wrote:Yep, this is when X3 needs to recreate pages after you changed something from the panel. If you have a heavy folder structure, this will definitely be the main reason why it takes 3-5 seconds. The question is though, do you have the preload option enabled? This would definitely be the reason why your server spends time ... You should disable it when you are editing.
I made some more tests as visitor (no preload but gallery wasn't edited recently) and still I waiting 3-5s to load the index. I also made a GT Metrix report (I will PM you) and all seems good.
mjau-mjau wrote:Not quite sure what you are trying to do. You just want a custom grid with a custom image? ... or are you trying to add the blog preview image like for example in the mjau-mjau blog posts? https://mjau-mjau.com/blog/ajax-universal-analytics/
Yep, only wanted to create a custom grid with a custom image but didn't worked.
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13998
Joined: 30 Sep 2006, 03:37

Re: What does X3 at first load?

10 Aug 2015, 12:04

gaitt wrote:Ok, but when you talk about the cached html file, does this cache system is activated when the preload is at false?
Caching is ALWAYS active, and is unrelated to the preload option. Once you create a page or make changes in the admin, your website effectively changes, and pages need to be built. Building a page can be heavy, and is proportional with the amount of folders in your content. Once a page is viewed once, it is cached, and consecutive calls to the page loads the cached file, for all visitors, which is super fast.

As for the preload option, it builds a JSON object of the entire website, and is therefore a very have task. It also gets cached though, so will load much faster after its created once after editing pages. The preload option is likely overkill for heavy content structures, and/or for servers that cannot handle it. You need to make sure your server can handle it. Below is the site object from our demo gallery ... As you can see, it loads fast, because it is cached:
https://demo.photo.gallery/services/site.json

You should perhaps not be using preload. Read about it here:
https://www.photo.gallery/x3docs/notes/
gaitt wrote:I made some more tests as visitor (no preload but gallery wasn't edited recently) and still I waiting 3-5s to load the index. .
Then something is not working. Did you try to disable the preload option? That is why I mentioned it. Could be you have a timeout on the preload option, which is bringing your server to its knees if it can never be created and therefore never gets cached. If it is disabled, there is no reason why your pages should not load fast after they have been visited at least once without no editing in between.

If you gave me an unprotected link to your gallery, I could actually check ...
gaitt wrote:I also made a GT Metrix report (I will PM you) and all seems good.
Yep looks good. The only thing about the "performance" checks though (metrix, pagespeed, yslow etc), is that they check "best practices" for implementation. If your server for some reason is slow to output the page itself, this will not necessarily be measured unless its REALLY slow. Therefore, that needs to be addressed separately, and 3-4 seconds load time is too long if the page is cached. Read more about X3 performance here:
https://forum.photo.gallery/viewtopic.php?f=51&t=8512
gaitt wrote:
mjau-mjau wrote:Not quite sure what you are trying to do. You just want a custom grid with a custom image? ... or are you trying to add the blog preview image like for example in the mjau-mjau blog posts? https://mjau-mjau.com/blog/ajax-universal-analytics/
Yep, only wanted to create a custom grid with a custom image but didn't worked.
I didn't quite get the answer if you are trying to output similar to the blog post I referred to above, or if you are trying to create your own grid. Creating custom grids in your content is not something we have actively supported, although it certainly should be possible.
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13998
Joined: 30 Sep 2006, 03:37

Re: What does X3 at first load?

10 Aug 2015, 12:11

Actually, I need to change my response slightly as I am looking at the "waterfall chart" of your GTMetrix review. Your website (the html part) is in fact output in 0.5 seconds (556 ms), which is fast. The entire website, including X3 JS app, CSS, fonts and homepage images are all loaded in a total of 3.81 seconds, which is not bad at all.
Image

If I could check your website myself, I could conclude personally that pages load fast.