mathforum
08-05-2012, 11:08 PM
Optimizing my site has been my biggest goal for a good while now and while at first I found lots of great info, I now see that this is almost impossible to fully accomplish. There seem to be inherent issues with vBulletin that analysis sites like webpagetest.org that cannot be fixed without significant recoding.
Just some basic info about my configuration:
1)All attachments, avatars and css should be stored as files outside the database
2)Not using a CDN yet
3)Have decently compressed all images related to my custom theme
4)Tried experimenting with rearranging headinclude template with no change for better or worse
5)All other settings should be aligned with standard optimal vb settings, but if I'll post more if more info is needed
I don't think I'd be allowed to paste the entire headinclude template so I'll leave out bits that can be referenced without code. Here's how it looks now.
<meta http-equiv="Content-Type" content="text/html; charset={vb:stylevar charset}" />
<meta id="e_vb_meta_bburl" name="vb_meta_bburl" content="{vb:raw vboptions.bburl}" />
<base href="{vb:raw basepath}" /><!--[if IE]></base><![endif]-->
<meta name="generator" content="vBulletin {vb:raw vboptions.templateversion}" />
<link href='http://fonts.googleapis.com/css?family=Passion+One' rel='stylesheet' type='text/css'/>
<link href='http://fonts.googleapis.com/css?family=Wellfleet' rel='stylesheet' type='text/css'/>
<link href='http://fonts.googleapis.com/css?family=Francois+One' rel='stylesheet' type='text/css'/>
<vb:if condition="$stylevar['favicon']">
<link rel="Shortcut Icon" href="{vb:stylevar favicon}" type="image/x-icon" />
</vb:if>
<vb:if condition="$show['threadinfo']">
<vb:elseif condition="$show['foruminfo']" />
<meta name="keywords" content="{vb:raw foruminfo.title_clean}, {vb:raw vboptions.keywords}" />
<meta name="description" content="<vb:if condition="$pagenumber > 1">{vb:rawphrase page_x, {vb:raw pagenumber}}-</vb:if>{vb:raw foruminfo.description_clean}" />
<vb:else />
<meta name="keywords" content="{vb:raw vboptions.keywords}" />
<meta name="description" content="{vb:raw vboptions.description}" />
</vb:if>
<vb:if condition="$show['fb_opengraph']">
{vb:raw facebook_opengraph}
</vb:if>
[YUI JAVASCRIPT CODE HERE]
<script type="text/javascript" src="{vb:raw vboptions.bburl}/clientscript/vbulletin-core.js?v={vb:raw vboptions.simpleversion}"></script>
{vb:raw template_hook.headinclude_javascript}
<vb:if condition="$vboptions['externalrss']">
<link rel="alternate" type="application/rss+xml" title="{vb:raw vboptions.bbtitle} {vb:rawphrase rss_feed}" href="{vb:raw vboptions.bburl}/external.php?type=RSS2" />
<vb:if condition="$show['foruminfo'] OR $show['threadinfo']">
<link rel="alternate" type="application/rss+xml" title="{vb:raw vboptions.bbtitle} - {vb:raw foruminfo.title_clean} - {vb:rawphrase rss_feed}" href="{vb:raw vboptions.bburl}/external.php?type=RSS2&forumids={vb:raw foruminfo.forumid}" />
</vb:if>
</vb:if>
<vb:if condition="$vboptions['storecssasfile']">
{vb:cssfile main-rollup.css}
{vb:raw template_hook.custom_css_links}
<vb:else />
{vb:cssfile bbcode.css,editor.css,popupmenu.css,reset-fonts.css,vbulletin.css,vbulletin-chrome.css,vbulletin-formcontrols.css{vb:raw template_hook.custom_css_list}}
</vb:if>
<!--[if lt IE 8]>
{vb:cssfile popupmenu-ie.css,vbulletin-ie.css,vbulletin-chrome-ie.css,vbulletin-formcontrols-ie.css,editor-ie.css}
<![endif]-->
{vb:raw template_hook.headinclude_css}
1) I think that the three inline CSS links should be added to additional.css if possible but I don't know how to do that.
2) I have a JS file that must be run on every page to render math equations, however I read that JS should be handled last since it stops the loading of other elements. For that reason I put it in the headinclude_bottom template, which looks like this for me now. Then hasn't changed the order in which things load.
{vb:cssfile additional.css}
{vb:raw template_hook.headinclude_bottom_css}
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js"],
jax: ["input/TeX", "output/HTML-CSS"],
tex2jax: {
inlineMath: [ ['$','$'], ['\\(','\\)'] ],
processEscapes: true
}
});
</script>
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/javascript" src="mobiquo/tapatalkdetect.js">
</script>
There are over 100 header requests to load my home page and it often goes back and forth between javascript and css, which isn't ideal. Has anyone had success with smoother loading? I've seen references to minimizing this and that, combining files, delaying javascript execution and lots of other things but really no decent explanations for them.
Any help or comment is greatly appreciated and I plan on improving upon some of the optimization articles here already since they've helped me a lot but are missing pieces!
Thank you.
Just some basic info about my configuration:
1)All attachments, avatars and css should be stored as files outside the database
2)Not using a CDN yet
3)Have decently compressed all images related to my custom theme
4)Tried experimenting with rearranging headinclude template with no change for better or worse
5)All other settings should be aligned with standard optimal vb settings, but if I'll post more if more info is needed
I don't think I'd be allowed to paste the entire headinclude template so I'll leave out bits that can be referenced without code. Here's how it looks now.
<meta http-equiv="Content-Type" content="text/html; charset={vb:stylevar charset}" />
<meta id="e_vb_meta_bburl" name="vb_meta_bburl" content="{vb:raw vboptions.bburl}" />
<base href="{vb:raw basepath}" /><!--[if IE]></base><![endif]-->
<meta name="generator" content="vBulletin {vb:raw vboptions.templateversion}" />
<link href='http://fonts.googleapis.com/css?family=Passion+One' rel='stylesheet' type='text/css'/>
<link href='http://fonts.googleapis.com/css?family=Wellfleet' rel='stylesheet' type='text/css'/>
<link href='http://fonts.googleapis.com/css?family=Francois+One' rel='stylesheet' type='text/css'/>
<vb:if condition="$stylevar['favicon']">
<link rel="Shortcut Icon" href="{vb:stylevar favicon}" type="image/x-icon" />
</vb:if>
<vb:if condition="$show['threadinfo']">
<vb:elseif condition="$show['foruminfo']" />
<meta name="keywords" content="{vb:raw foruminfo.title_clean}, {vb:raw vboptions.keywords}" />
<meta name="description" content="<vb:if condition="$pagenumber > 1">{vb:rawphrase page_x, {vb:raw pagenumber}}-</vb:if>{vb:raw foruminfo.description_clean}" />
<vb:else />
<meta name="keywords" content="{vb:raw vboptions.keywords}" />
<meta name="description" content="{vb:raw vboptions.description}" />
</vb:if>
<vb:if condition="$show['fb_opengraph']">
{vb:raw facebook_opengraph}
</vb:if>
[YUI JAVASCRIPT CODE HERE]
<script type="text/javascript" src="{vb:raw vboptions.bburl}/clientscript/vbulletin-core.js?v={vb:raw vboptions.simpleversion}"></script>
{vb:raw template_hook.headinclude_javascript}
<vb:if condition="$vboptions['externalrss']">
<link rel="alternate" type="application/rss+xml" title="{vb:raw vboptions.bbtitle} {vb:rawphrase rss_feed}" href="{vb:raw vboptions.bburl}/external.php?type=RSS2" />
<vb:if condition="$show['foruminfo'] OR $show['threadinfo']">
<link rel="alternate" type="application/rss+xml" title="{vb:raw vboptions.bbtitle} - {vb:raw foruminfo.title_clean} - {vb:rawphrase rss_feed}" href="{vb:raw vboptions.bburl}/external.php?type=RSS2&forumids={vb:raw foruminfo.forumid}" />
</vb:if>
</vb:if>
<vb:if condition="$vboptions['storecssasfile']">
{vb:cssfile main-rollup.css}
{vb:raw template_hook.custom_css_links}
<vb:else />
{vb:cssfile bbcode.css,editor.css,popupmenu.css,reset-fonts.css,vbulletin.css,vbulletin-chrome.css,vbulletin-formcontrols.css{vb:raw template_hook.custom_css_list}}
</vb:if>
<!--[if lt IE 8]>
{vb:cssfile popupmenu-ie.css,vbulletin-ie.css,vbulletin-chrome-ie.css,vbulletin-formcontrols-ie.css,editor-ie.css}
<![endif]-->
{vb:raw template_hook.headinclude_css}
1) I think that the three inline CSS links should be added to additional.css if possible but I don't know how to do that.
2) I have a JS file that must be run on every page to render math equations, however I read that JS should be handled last since it stops the loading of other elements. For that reason I put it in the headinclude_bottom template, which looks like this for me now. Then hasn't changed the order in which things load.
{vb:cssfile additional.css}
{vb:raw template_hook.headinclude_bottom_css}
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js"],
jax: ["input/TeX", "output/HTML-CSS"],
tex2jax: {
inlineMath: [ ['$','$'], ['\\(','\\)'] ],
processEscapes: true
}
});
</script>
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/javascript" src="mobiquo/tapatalkdetect.js">
</script>
There are over 100 header requests to load my home page and it often goes back and forth between javascript and css, which isn't ideal. Has anyone had success with smoother loading? I've seen references to minimizing this and that, combining files, delaying javascript execution and lots of other things but really no decent explanations for them.
Any help or comment is greatly appreciated and I plan on improving upon some of the optimization articles here already since they've helped me a lot but are missing pieces!
Thank you.