Keyword
Please note that official support for commercial extensions & templates is provided in the Subscriber Help Desk.
Support requests should ONLY be directed there and require an active subscription plan.
This forum board is to be used for archive purposes and knowledge exchange ONLY.

Performance Problems In Multi-Page Content Items

  • Oleksiy Shevchukevych
  • Oleksiy Shevchukevych's Avatar Topic Author
  • Offline
  • Junior Member
More
17 years 10 months ago #3273 by Oleksiy Shevchukevych
Performance Problems In Multi-Page Content Items was created by Oleksiy Shevchukevych
Hi Guys,

It took me a while to figure out that Simple Image Gallery PRO creates performance problems when I use it in multipage content item.

I have content item splitted up into 17 pages. Each page contains 2 galleries and every gallery consists of just one image. The total number of such-one page galleries is 35. Given such a setup I'm having 2 problems:

1) It takes extremely long to access any of content item's subpage (around 14 seconds)

2) When I access any of content item's subpage using IE, web site's template just drops

You can access multi-page content item I'm having problems with using this URL:

www.boxingcoachmike.com/index.php?option=com_content&task=view&id=8&Itemid=10000

If I remove all galleries from this multi-page content item everything works just fine.

Thanks
Cheetah

Please Log in or Create an account to join the conversation.

More
17 years 10 months ago #3274 by JoomlaWorks
Please switch popup engine to e.g. Slimbox and check again. Lytebox -the one you use- uses php output buffering which might be "heavy" on your server. Let me know...

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Oleksiy Shevchukevych
  • Oleksiy Shevchukevych's Avatar Topic Author
  • Offline
  • Junior Member
More
17 years 10 months ago #3275 by Oleksiy Shevchukevych
Replied by Oleksiy Shevchukevych on topic Re: Performance Problems In Multi-Page Content Items
I've tried every popup engine. Problems still exist.

Thanks
Cheetah

Please Log in or Create an account to join the conversation.

More
17 years 10 months ago #3276 by JoomlaWorks
OK, try this. Open up the file mambots/content/plugin_jw_sigpro.php and at about line 284, replace this block of code:
				// create thumbnails
				if (file_exists($tempfolder.md5($_images_dir_.$name).$format) && filemtime ($tempfolder.md5($_images_dir_.$name).$format) + $cache_expire_time * 60 > time()) {
				 $html .= $leftcomment.'<img alt="'.$clickopen.'" title="'.$clickopen.'" src="'.$tempfolder.md5($_images_dir_.$name).$format.'" />'.$rightcomment;
				} else {
				 $fromname = $mosConfig_absolute_path.$rootfolder.$_images_dir_.'/'.$images[$a];
				 $toname = $mosConfig_absolute_path.$tempfolder.md5($_images_dir_.$name).".".$format;
				 $toname_live = $mosConfig_live_site.$tempfolder.md5($_images_dir_.$name).".".$format;
				 $result = makeThumb( $fromname, $toname, $image_type, $_quality_, $_width_final_, $_height_final_);
				 if($result)
				    $html .=$leftcomment.'<img alt="'.$clickopen.'" title="'.$clickopen.'" src="'.$toname_live.'" />'.$rightcomment;
				 else
				    $html .='<span>Error creating thumbnail!</span>';
				}

with this:
				// create thumbnails
				$toname = $mosConfig_absolute_path.$tempfolder.md5($_images_dir_.$name).".".$format;
				$toname_live = $mosConfig_live_site.$tempfolder.md5($_images_dir_.$name).".".$format; 
				
				if (file_exists($toname) && (filemtime ($toname) + $cache_expire_time * 60 > time())) {
					$html .= $leftcomment.'<img alt="'.$clickopen.'" title="'.$clickopen.'" src="'.$toname_live.'" />'.$rightcomment; 
				} else {
					$fromname = $mosConfig_absolute_path.$rootfolder.$_images_dir_.'/'.$images[$a];
					$result = makeThumb( $fromname, $toname, $image_type, $_quality_, $_width_final_, $_height_final_);
					if($result) {
					$html .= $leftcomment.'<img alt="'.$clickopen.'" title="'.$clickopen.'" src="'.$toname_live.'" />'.$rightcomment;
					} else {
					$html .= '<span>Error creating thumbnail!</span>';
					}
				}	

Let me know...

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Oleksiy Shevchukevych
  • Oleksiy Shevchukevych's Avatar Topic Author
  • Offline
  • Junior Member
More
17 years 10 months ago #3277 by Oleksiy Shevchukevych
Replied by Oleksiy Shevchukevych on topic Re: Performance Problems In Multi-Page Content Items
Hi Fotis,

Thanks, it helped. Problem #1 is gone. Although problem #2 still exists. i.e. in IE template drops and I'm getting some javascript errors. In Firefox everything is fine.

Thanks
Oleksiy

Please Log in or Create an account to join the conversation.

  • Oleksiy Shevchukevych
  • Oleksiy Shevchukevych's Avatar Topic Author
  • Offline
  • Junior Member
More
17 years 10 months ago #3278 by Oleksiy Shevchukevych
Replied by Oleksiy Shevchukevych on topic Re: Performance Problems In Multi-Page Content Items
I've switched to Lytebox popup engine and I'm not getting JavaScript errors anymore. But template is still missing in IE.

Cheetah

Please Log in or Create an account to join the conversation.

More
17 years 10 months ago #3279 by JoomlaWorks
Well, for one let me note that your servers is a bit slow on response. Now try this. Change this part in your template:
<!--[if lte IE 7]>
<link href="http://www.boxingcoachmike.com/templates/rt_sporticus_v2/css/template_ie7.css" rel="stylesheet" type="text/css" />
<![endif]-->
<!--[if lte IE 6]>
<link href="http://www.boxingcoachmike.com/templates/rt_sporticus_v2/css/template_ie.css" rel="stylesheet" type="text/css" />
<![endif]-->

with this:
<!--[if IE 7]>
<link href="http://www.boxingcoachmike.com/templates/rt_sporticus_v2/css/template_ie7.css" rel="stylesheet" type="text/css" />
<![endif]-->
<!--[if lte IE 6]>
<link href="http://www.boxingcoachmike.com/templates/rt_sporticus_v2/css/template_ie.css" rel="stylesheet" type="text/css" />
<![endif]-->

Perhaps the 2 stylesheets conflicted. Notice that the change is on the first "if" statement. Get back to me...

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Oleksiy Shevchukevych
  • Oleksiy Shevchukevych's Avatar Topic Author
  • Offline
  • Junior Member
More
17 years 10 months ago #3280 by Oleksiy Shevchukevych
Replied by Oleksiy Shevchukevych on topic Re: Performance Problems In Multi-Page Content Items
Changed the template. It still doesn't work.

As for slownes, I have noticed that it's slow only when first request is made after a while. Any subsequent request is much faster. Probably thubnails get regenerated that's why it's taking so long

Thanks
Cheetah

Please Log in or Create an account to join the conversation.

More
17 years 10 months ago #3281 by JoomlaWorks
What time have you set for the thumb cache in the plugin's parameters?

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Oleksiy Shevchukevych
  • Oleksiy Shevchukevych's Avatar Topic Author
  • Offline
  • Junior Member
More
17 years 10 months ago #3282 by Oleksiy Shevchukevych
Replied by Oleksiy Shevchukevych on topic Re: Performance Problems In Multi-Page Content Items
It is set to default value which is 120 seconds

Thanks
Cheetah

Please Log in or Create an account to join the conversation.

More
17 years 10 months ago #3283 by JoomlaWorks
Have you tested this locally to see how it behaves?

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Oleksiy Shevchukevych
  • Oleksiy Shevchukevych's Avatar Topic Author
  • Offline
  • Junior Member
More
17 years 10 months ago #3284 by Oleksiy Shevchukevych
Replied by Oleksiy Shevchukevych on topic Re: Performance Problems In Multi-Page Content Items
You mean css issue? I haven't tested it locally. But one thing that I've noticed is if I reduce the number of galleries in that multi page content item the problem disappears.

Cheetah

Please Log in or Create an account to join the conversation.

  • Oleksiy Shevchukevych
  • Oleksiy Shevchukevych's Avatar Topic Author
  • Offline
  • Junior Member
More
17 years 10 months ago #3285 by Oleksiy Shevchukevych
Replied by Oleksiy Shevchukevych on topic Re: Performance Problems In Multi-Page Content Items
Ok, I found where the problem is. It looks like there are to many styles defined and IE just can't handle these:

<style type="text/css" media="all">#sigid0.sig .sig_cont {width:360px;height:290px;}</style>
<style type="text/css" media="all">#sigid1.sig .sig_cont {width:360px;height:290px;}</style>
<style type="text/css" media="all">#sigid2.sig .sig_cont {width:360px;height:290px;}</style>
............
<style type="text/css" media="all">#sigid33.sig .sig_cont {width:243px;height:360px;}</style>
<style type="text/css" media="all">#sigid34.sig .sig_cont {width:470px;height:358px;}</style>

I think it's a bug in your mambot. Each sigid corresponds to one gallery. So in case of multi-page content item you should not output all sigids for every subpage. I.e the first sub page (www.boxingcoachmike.com/index.php?option=com_content&task=view&id=8&Itemid=10000) should have just these sigids defined:

<style type="text/css" media="all">#sigid0.sig .sig_cont {width:360px;height:290px;}</style>
<style type="text/css" media="all">#sigid1.sig .sig_cont {width:360px;height:290px;}</style>

Please, let me know if you are going to fix it or if you can think of any work around.

Thanks
Cheetah

Please Log in or Create an account to join the conversation.

More
17 years 10 months ago #3286 by JoomlaWorks
I'm afraid this is the way Joomla works for multi-page content items. We can't do much about it. But you can try this. Since the pages I saw all have the same -more or less- thumb dimensions, I would recommend adding these width/height values as default in your plugin's parameters.  ;)

Then if you don't set the dimensions on all 20 galleries (!) but a few, then you won't get these issues in IE. Just a thought...

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Oleksiy Shevchukevych
  • Oleksiy Shevchukevych's Avatar Topic Author
  • Offline
  • Junior Member
More
17 years 10 months ago #3287 by Oleksiy Shevchukevych
Replied by Oleksiy Shevchukevych on topic Re: Performance Problems In Multi-Page Content Items
I tried that. It still generates all those sigs and messes up in IE.

Cheetah

Please Log in or Create an account to join the conversation.

  • Oleksiy Shevchukevych
  • Oleksiy Shevchukevych's Avatar Topic Author
  • Offline
  • Junior Member
More
17 years 10 months ago #3288 by Oleksiy Shevchukevych
Replied by Oleksiy Shevchukevych on topic Re: Performance Problems In Multi-Page Content Items
Do you see any problem if I just remove sigids for that particular content item? I've removed sigid css definition and div tag and it works just fine.

Thanks
Cheetah

Please Log in or Create an account to join the conversation.

More
17 years 10 months ago #3289 by JoomlaWorks
Well, they were there for some reason... :D

If you remove them, then you will not be able to control dimensions on a per gallery basis.  ;)

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Oleksiy Shevchukevych
  • Oleksiy Shevchukevych's Avatar Topic Author
  • Offline
  • Junior Member
More
17 years 10 months ago #3290 by Oleksiy Shevchukevych
Replied by Oleksiy Shevchukevych on topic Re: Performance Problems In Multi-Page Content Items
Ok, I found the solution. Instead of declaring <style> tag for each sigid you need to wrap them up in one single <style> tag. I.e. instead of having this:

<style type="text/css" media="all">#sigid0.sig .sig_cont {width:360px;height:290px;}</style>
<style type="text/css" media="all">#sigid1.sig .sig_cont {width:360px;height:290px;}</style>
<style type="text/css" media="all">#sigid2.sig .sig_cont {width:360px;height:290px;}</style>
............
<style type="text/css" media="all">#sigid33.sig .sig_cont {width:243px;height:360px;}</style>
<style type="text/css" media="all">#sigid34.sig .sig_cont {width:470px;height:358px;}</style>

, it should be this:

<style type="text/css" media="all">
#sigid0.sig .sig_cont {width:360px;height:290px;}
#sigid1.sig .sig_cont {width:360px;height:290px;}
#sigid2.sig .sig_cont {width:360px;height:290px;}
............
#sigid33.sig .sig_cont {width:243px;height:360px;}
#sigid34.sig .sig_cont {width:470px;height:358px;}
</style>

Can you provide a fix? It's really critical for me to get it working.

Thanks
Cheetah

Please Log in or Create an account to join the conversation.

More
17 years 10 months ago #3291 by JoomlaWorks
The plugin (all joomla plugins!) works like this:

- User visits page
- Page starts to render
- When "joomla" finds a plugin/mambot tag it processes it until the content item is rendered.

Now, each time the plugin tags are processed, this <style> tag is written. And it is written all over again, depending on how many plugin tags you have on your page. The css/js file calls are the same, they do not change. So we can tell joomla, "start the plugin processing, but if you find the SAME occurrence again, do not redisplay the css/js calls". Unfortunately, we cannot do the same for the <style> tags, in the way you mention. Cause the processing is done serially.

tags processed, style tag written
tags processed, style tag written
...
tags processed, style tag written

You cannot wrap all of them in <style>...</style>.

It's the way plugins work, which is what I told you in one of my messages earlier.

I can help you hack the plugin to not show the <style> tags at all. But you will not be able to add galleries with custom dimensions.

Let me know.

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Oleksiy Shevchukevych
  • Oleksiy Shevchukevych's Avatar Topic Author
  • Offline
  • Junior Member
More
17 years 10 months ago #3292 by Oleksiy Shevchukevych
Replied by Oleksiy Shevchukevych on topic Re: Performance Problems In Multi-Page Content Items
I already hacked the plugin not to show <style> tags for sigids only for that specific content item page (so it doesn't affect galleries on othe pages). But it's still lookw weird in IE 7.0:

www.boxingcoachmike.com/index.php?option=com_content&task=view&id=8&Itemid=10000

In Firefox it looks just fine. If you can help to shrink outer bound bar to the size of thubnail so it looks in IE the same way as in Firefox, it would be great. I can send you my current plugin_jw_sigpro.php if you like

Thanks
Cheetah

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum