Post by haxcop » Wed May 25, 2022 3:41 am

Hello, I would like to know if there's a known way to re-generate the Image Cache folder using the cli without the need to navigate to each page/product one at a time?

Very important to me as I'm recreating a site with more than 15k items and this will crash due to a time out when trying to navigate to any item
I have tried without any images and the site is very fast and responsive but as soon as I link the images this will be very slow.

Version 3.0.3.6
Php 7.3
Mysql 8

Thanks,
Last edited by haxcop on Mon Feb 06, 2023 4:14 am, edited 1 time in total.

New member

Posts

Joined
Tue Jan 14, 2014 9:38 pm
Location - Dublin

Post by paulfeakins » Wed May 25, 2022 7:38 pm

I don't believe there's a way to do it built-in to OpenCart but you could use this command to browse every page:

Hit All Pages of a Website (4 levels deep) - useful if you've cleared the cache and it doesn't automatically regenerate:

Code: Select all

wget --spider -r -l4 website-to-spider.com
From here: https://www.antropy.co.uk/blog/handy-linux-commands/

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by by mona » Wed May 25, 2022 9:04 pm

As stated above, normally you would run a local spider on your site to generate the images when the cache has been deleted but in your case that spider may well crash as well.

When your page slows / crashes (probably time out or memory) because it needs to generate the images on it, your images are probably too big or you have too many images on your page or both.
You can increase the script runtime limit but that will only take you so far.

If you want to generate one image at a time via CLI, you would have to create a script for that and an image inventory (file, dimensions, etc) and there is none.

So first find out if the crash is a time out, a memory limit or a corrupt image. Then check the original images dimensions and the amount of images you put on any given page.

DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.


https://www.youtube.com/watch?v=zXIxDoCRc84


User avatar
Expert Member

Posts

Joined
Mon Jun 10, 2019 9:31 am

Post by rempong » Thu May 26, 2022 8:39 pm

haxcop wrote:
Wed May 25, 2022 3:41 am
Hello, I would like to know if there's a known way to re-generate the Image Cache folder using the cli without the need to navigate to each page/product one at a time?

Very important to me as I'm recreating a site with more than 15k items and this will crash due to a time out when trying to navigate to any item
I have tried without any images and the site is very fast and responsive but as soon as I link the images this will be very slow.

Version 3.0.3.6
Php 7.3
Mysql 8

Thanks,
I think you should fix the core problem first: error while generating image. Check your error log/ server log for error message.

OPENCART MODULE :
Opencart Compare Link Link your compared product to forum/email

Frontend Link From Admin Dashboard
Get link to product , category, manufacturer, information from admin backend.

Copy and DIRECTLY Edit Product the easy way.

Custom Product Sort Full control to product sorting options

Already Sold Product Module, shows total product sold


Active Member

Posts

Joined
Fri Sep 14, 2012 2:38 pm
Location - Indonesia
Who is online

Users browsing this forum: No registered users and 268 guests