Speeding up Autonav
Permalink
Hi Everyone,
I've had some significant speed issues with my site athttp://technicskn7000.com/ and I narrowed some of them down to Autonav.
I removed the hardcoded Autonav from the template and put it in a Global Area in the header, this took about a second off my load time.
I then used "View Source" to simply copy the html output of the Autonav and I've pasted that into an html block and put it in the same global area. This takes another six seconds off my load time, making the load time fairly acceptable.
I'll start looking into other ways to improve in the near future but in the meantime I'm wondering if anyone has ideas how to semi-automate generating the Autonav as html?
At the moment obviously anytime I add, move or copy a page I have to add back the Autonav, view source and then add back the html code. I've set the Autonav to display all pages beneath my top level so I can carry out this procedure on a hidden page and then paste the html into an html block inside a stack (which displays in the Global Area in my header). So, the updates are seamless for visitors but I would like to make it slightly easier for myself because my navigation changes quite regularly.
Thanks in advance,
Mike
I've had some significant speed issues with my site athttp://technicskn7000.com/ and I narrowed some of them down to Autonav.
I removed the hardcoded Autonav from the template and put it in a Global Area in the header, this took about a second off my load time.
I then used "View Source" to simply copy the html output of the Autonav and I've pasted that into an html block and put it in the same global area. This takes another six seconds off my load time, making the load time fairly acceptable.
I'll start looking into other ways to improve in the near future but in the meantime I'm wondering if anyone has ideas how to semi-automate generating the Autonav as html?
At the moment obviously anytime I add, move or copy a page I have to add back the Autonav, view source and then add back the html code. I've set the Autonav to display all pages beneath my top level so I can carry out this procedure on a hidden page and then paste the html into an html block inside a stack (which displays in the Global Area in my header). So, the updates are seamless for visitors but I would like to make it slightly easier for myself because my navigation changes quite regularly.
Thanks in advance,
Mike
I believe this is the same answer I gave you a month ago via PM;-)
If it were my site, I would limit the main AutoNav to only one level and then on each of these first level of landing pages, I would re-design them so they contain a smaller AutoNav in the sidebar that looks only under itself. Right now, on the landing pages, you have the top AutoNav AND what appears to be another complete-tree AutoNav in the left sidebar. That's a lot of processing.
If it were my site, I would limit the main AutoNav to only one level and then on each of these first level of landing pages, I would re-design them so they contain a smaller AutoNav in the sidebar that looks only under itself. Right now, on the landing pages, you have the top AutoNav AND what appears to be another complete-tree AutoNav in the left sidebar. That's a lot of processing.
Yes I really gained a lot from the advice you gave me in your PM, I'm very grateful.
I realise that I could reduce processing by changing my navigation but I don't want to change my navigation.
The conversion to html has given me acceptable load times so I'm just hoping to build on that. One thing I will do is remove breadcrumbs from the template. But I want the main nav to work essentially as it is. Hoping to find a quick way of doing that because it has made a huge speed improvement for visitors.
I realise that I could reduce processing by changing my navigation but I don't want to change my navigation.
The conversion to html has given me acceptable load times so I'm just hoping to build on that. One thing I will do is remove breadcrumbs from the template. But I want the main nav to work essentially as it is. Hoping to find a quick way of doing that because it has made a huge speed improvement for visitors.
If you want to maintain the nav as it is, I'd recommend to ask JohntheFish if his UberList Add-on would do the job:
https://www.concrete5.org/marketplace/addons/uber-list/...
It takes a little to configure properly but I believe it will do the job. Or: try to implement Varnish Cache to your site to speed up the whole thing.
I havent yet understood why you change the nav regularly - it seems very complex with a lot of material for all the different models - why do you need to add more items to it?
https://www.concrete5.org/marketplace/addons/uber-list/...
It takes a little to configure properly but I believe it will do the job. Or: try to implement Varnish Cache to your site to speed up the whole thing.
I havent yet understood why you change the nav regularly - it seems very complex with a lot of material for all the different models - why do you need to add more items to it?
I'm just about to get a big bundle of addons off JTF and that is one of them so I will definitely look at that option thanks.
Regarding the nav changes - new pages are added regularly. Some pages get retired, moved, archives or put in the members area when this happens. Site is only a year old and I'm getting great organic results and good feedback from users. Eventually I'll probably slim down the nav but I'm nervous to do that yet because experiments have shown that the length of time that people spend on the site reduces a lot when I try that. I think that the nav is giving visitors a quick overview of what is available, and that encourages them to explore.
Thanks for the advice I appreciate it.
Take a look at this article by jordanlev: http://concrete5tricks.com/blog/dont-hardcode-blocks-use-a-global-a...
Your autonav will be cached instead of rebuilt every page request, and will still be dynamic so you don't need to copy the html output continually.
Your autonav will be cached instead of rebuilt every page request, and will still be dynamic so you don't need to copy the html output continually.
Thanks I've already tried that as mentioned above. It took one second off the load time compared to the html method which takes a total of seven seconds off the load time.
You did too... I'm not sure then, sorry.
Nono, I appreciate every suggestion thanks for responding :)
...and it did speed things up plus I prefer how it works in a global area
I'm currently absolutely delighted at saving seven seconds, I'm just seeking some icing on my cake
@designserve
One enormous opportunity for improving the site load speed is the use of GZIP compression. It is quick and easy.
As an example:
Your home page is 670 KB. Which is not large at all, but when every second counts you need to look for ways to improve load times.
Using GZIP would probably cut the size in half.
One enormous opportunity for improving the site load speed is the use of GZIP compression. It is quick and easy.
As an example:
Your home page is 670 KB. Which is not large at all, but when every second counts you need to look for ways to improve load times.
Using GZIP would probably cut the size in half.
Thank you, I'm aware of GZIP and I'm told it is available to me on the server but I don't know what to do next, can you point me at some information to help with implementing it please?
What web host are you using?
Is your site running in a subdirectory of public_html or the root?
GZIP is enabled in the .htaccess file.
This link highlights the section used for enabling GZIP.
https://github.com/h5bp/html5-boilerplate/blob/master/dist/.htaccess...
Is your site running in a subdirectory of public_html or the root?
GZIP is enabled in the .htaccess file.
This link highlights the section used for enabling GZIP.
https://github.com/h5bp/html5-boilerplate/blob/master/dist/.htaccess...
Hi,
For GZIP compression add following lines to .htaccess file
<ifModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file \.(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</ifModule>
Thanks
For GZIP compression add following lines to .htaccess file
<ifModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file \.(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</ifModule>
Thanks
Hi thanks to all who helped here. I'm on 1and1 and the site is in a subdirectory.
I tried the gzip solutions above to no avail but an Internet search told me about the following script which works on 1and1:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteOptions Inherit
ReWriteCond %{HTTP:accept-encoding} (gzip.*)
ReWriteCond %{REQUEST_FILENAME} !.+\.gz$
RewriteCond %{REQUEST_FILENAME}.gz -f
RewriteRule (.+) $1.gz [QSA,L]
</IfModule>
It does work, however, it does mean that I have to gzip all the files I want to serve so that is for another day because there are a lot of them!
The gzip idea is an aside at the moment, still working on automating the flip from autonav to static html for the navigation, looking at removing breadcrumbs and thinking about simplifying the nav slightly. In discussion with a friend who knows a lot more about php than me.
I tried the gzip solutions above to no avail but an Internet search told me about the following script which works on 1and1:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteOptions Inherit
ReWriteCond %{HTTP:accept-encoding} (gzip.*)
ReWriteCond %{REQUEST_FILENAME} !.+\.gz$
RewriteCond %{REQUEST_FILENAME}.gz -f
RewriteRule (.+) $1.gz [QSA,L]
</IfModule>
It does work, however, it does mean that I have to gzip all the files I want to serve so that is for another day because there are a lot of them!
The gzip idea is an aside at the moment, still working on automating the flip from autonav to static html for the navigation, looking at removing breadcrumbs and thinking about simplifying the nav slightly. In discussion with a friend who knows a lot more about php than me.
You do not have to GZIP anything manually.
Once you've added that code to your .htaccess, the server will do all that on the fly when sending out to the requests. It is just copying and pasting that code.
Once you've added that code to your .htaccess, the server will do all that on the fly when sending out to the requests. It is just copying and pasting that code.
I wish that was the case but with 1and1 it isn't. You can see from reading the above code that if you want to compress(say) discussion.css then the file discussion.css.gz has to exist. And running tests shows that is the case.
I know that many here don't like 1and1 but up to now I've been happy with them. Not very happy that they don't support compression in a simple way right now.
I know that many here don't like 1and1 but up to now I've been happy with them. Not very happy that they don't support compression in a simple way right now.
Oh, sorry, didn't know that :)
@designserve
Manually configuring individual GZIP files is not efficient and should not be your only option.
These are directions from 1and1:
http://community.1and1.com/increase-client-performance-with-mod-def...
They only include a fraction of all the available file types that can, and should, be compressed.
Here is a recommended list of file types you should be using. I would follow the 1and1 instructions but paste this instead.
https://github.com/h5bp/html5-boilerplate/blob/master/dist/.htaccess...
Manually configuring individual GZIP files is not efficient and should not be your only option.
These are directions from 1and1:
http://community.1and1.com/increase-client-performance-with-mod-def...
They only include a fraction of all the available file types that can, and should, be compressed.
Here is a recommended list of file types you should be using. I would follow the 1and1 instructions but paste this instead.
https://github.com/h5bp/html5-boilerplate/blob/master/dist/.htaccess...
The autonav block basically "scans" for all pages on the sitemap that match your autonav options (like: all child pages of current page) and displays them as a List.
With all your pages and subpages, this is a lot of work to do for the autonav.
You could try to repace the autonav with a PageList block which works the other way around - it includes all the pages you've set to be included (by page type, location...) which may reduce the time of "scanning" if there are even more subpages that are not displayed in your current nav.
But mostly, I would look for a caching solution, like turning on full page cache or block cache or look for a add-on that provides better caching.
Check out "Uber List" from JohntheFish, I used it once and it is extremely flexible and has caching on its own.