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.

Never create new thumbnails

  • sinicure
  • sinicure's Avatar Topic Author
  • Offline
  • New Member
More
16 years 11 months ago #14949 by sinicure
Never create new thumbnails was created by sinicure
How do I get it to never create new thumbnails or atleast only create them once a month or so. All my photos are static which a rarely update, I find whenever I view my page the page is slow to load. I applied the performance hack and adjusted the thumbnail cache in the site mambot to 40500 (about a month) yet 10 minutes later if i reload the page new thumbnails get created. what should the cache be set at also do I need to change the $cache_expire_time * 60 > time via the plugin_jw_sigpro.php file?

Thanks

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

More
16 years 11 months ago #14950 by MP Media
Replied by MP Media on topic Re: Never create new thumbnails
We had a similar performance issue as we have a blog of sigpro galleries on the same page and was very slow - we used a component called JRE cache (it's a cache component for the whole site) and this sped it up enormously. (if we update pics we then clear the cache and reload page and it stays cached for as long as you want.

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

  • sinicure
  • sinicure's Avatar Topic Author
  • Offline
  • New Member
More
16 years 11 months ago #14951 by sinicure
Replied by sinicure on topic Re: Never create new thumbnails
JRE Cache worked great, thanks! There must be a way to have the cache timeout work properly without the need for JRE cache, hopefully one of the staff will read this and give an answer.

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

  • JoomlaWorks Support Team
  • JoomlaWorks Support Team's Avatar
  • Offline
  • Platinum Member
More
16 years 11 months ago #14952 by JoomlaWorks Support Team
Replied by JoomlaWorks Support Team on topic Re: Never create new thumbnails
Hi my friends!

The script checks the creation time of the thumb respect the current time.
If the script see that the creation time is too small respect the time you gave
at the config page of the plugin, tries to regenerate the thumb.

The issue you talk about remembers me an old bug of the sig pro
but in the latest version is fixed.

Can you please post the 3-4 lines of sig pro where you can find the $cache_expire_time?

Thank you!

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

  • sinicure
  • sinicure's Avatar Topic Author
  • Offline
  • New Member
More
16 years 11 months ago - 16 years 11 months ago #14953 by sinicure
Replied by sinicure on topic Re: Never create new thumbnails
// create thumbnails
				if (file_exists($tempfolder.md5($_images_dir_.$name).".".$format) && filemtime ($tempfolder.md5($_images_dir_.$name).".".$format) + $cache_expire_time * 120 > time()) {
				 $html .= $leftcomment.'<img alt="'.$clickopen.'" title="'.$clickopen.'" src="'.$mosConfig_live_site.$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>';
				}

I've tried seting the cache to 45000 (about a month) in both the above code and the config area of the mambot but niether change made a difference. I tried changing them both to 0 (assuming that would be never refresh) but it had the same results. In either case it would cache the thumbnails for about 10 minutes.

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

  • JoomlaWorks Support Team
  • JoomlaWorks Support Team's Avatar
  • Offline
  • Platinum Member
More
16 years 11 months ago #14954 by JoomlaWorks Support Team
Replied by JoomlaWorks Support Team on topic Re: Never create new thumbnails
Hmmm... the script is correct...

Seems that the time of modification of the thumb ( file ) isn't correct.
Please, can you try to replace the function filemtime   with the filectime ?

Can you give me the value of the filemtime ( if it is possible ) ?

Thank you!

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

  • sinicure
  • sinicure's Avatar Topic Author
  • Offline
  • New Member
More
16 years 11 months ago - 16 years 4 months ago #14955 by sinicure
Replied by sinicure on topic Re: Never create new thumbnails
I replaced the filemtime with filectime as shown in the following script (i think that's what you were getting at)

// create thumbnails
if (file_exists($tempfolder.md5($_images_dir_.$name).".".$format) && filectime ($tempfolder.md5($_images_dir_.$name).".".$format) + $cache_expire_time * 120 > time()) {
$html .= $leftcomment.'<img alt="'.$clickopen.'" title="'.$clickopen.'" src="'.$mosConfig_live_site.$tempfolder.md5($_images_dir_.$name).".".$format.'" />'.$rightcomment;
} else {

As for the value of the filemtime, I'm not exactly sure what you mean? If you mean the time the thumbs are modified, the modification times are current. If I reload the page and hour from now, they will be recreated in the temp directory.
I also have another issue where the thumbs are not displayed properly when I click on menu links. Here is the site in question:
http://www.timelesswedding.ca/practice
If I click on the links across the top everything works well (except the load time of course), if I click on the links in the main menu (on the right) the thumbnails don't display correctly and if I click on one of the thumbs, the larger image displays in a pop up window. If I delete the cache the same thing will happen differently, it depends on which link you click on first. for example if I click on the services link at the top first, then the services link on the right shows the page incorrectly, and vice versa, same for the other pages, which ever link is clicked first the corresponding link in the other menu displays the thumbs incorrectly (as if the gallery script isn't being loaded properly.
Here's the plugin_jw_sigpro .php for reference if you need it.
****
I hope this all makes sense!
I appreciate the help

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


Powered by Kunena Forum