Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com
I don't really understand why you want to rename cached image files.KanKan2022 wrote: ↑Tue Aug 09, 2022 7:58 pmThanks for your reply. With the resize function, do you mean when it converts the image files into its cache files at different dimensions? I can rename all my cache images in a couple of minutes, but to convert all the image files to their cache counterpart would take a very long time, hence I'm wondering why renaming them doesn't seem to work?
Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com
Rename in image/catalog/product_A-folder/IMG_1234.jpg to image/catalog/product_A-folder/product_A.jpg (and rename every image that is assigned to every product, sequentially: -2.jpg, -3.jpg etc.
Update corresponding database entries: product SET image, product_image SET image
And in image/cache/catalog/product_A/IMG_1234-100x100.jpg, IMG_1234-40x40.jpg, etc rename substring IMG_1234 to product_A so it becomes image/cache/catalog/product_A/product_A-100x100.jpg, product_A-40x40.jpg etc. and do this for every image of every product.
All of this works, so my question is why is my front end so slow after doing this - it is slow as though it is regenerating the cache files, but it isn't. The renamed cache files remain unchanged. Is there another part of opencart that I have missed that needs to be changed also?
thekrotek - If I just rename the image files and database entries, the front end becomes super slow because it needs to regenerate all the cache image files again on a page visit- it is much much quicker for me to just rename those files if opencart can accept that and not slow down the front end on a first page visit again, that is why I am looking at it this way thanks.
Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com
Because it doesn't work. And as others have said this is NOT the correct way to do this.KanKan2022 wrote: ↑Wed Aug 10, 2022 6:20 amAll of this works, so my question is why is my front end so slow
Rename your source files and let OpenCart take care of the cache files.
Don't mess about with scripts and changing the database.
UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk
Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig
@JNeuhoff Could you please tell me how to check the owner/group - thanks
Your browser, however, will disregard the possible browser cached old images and does have to load the new images as the url has been changed.
So if you have many images on a page and do not lazy load them and even use http/1.1, then that tends to slow things down on first page load.
This of course disregarding any possible extensions you may have that act on images.
if the slowdown is severe, I still expect that the system believes the original is newer or the cached image does not exist.
You can check this by putting in catalog/model/tool/image.php
Code: Select all
if (!is_file(DIR_IMAGE . $image_new)) {
$this->log->write('Image cache does not exist, creating: '.DIR_IMAGE . $image_new);
} elseif (filemtime(DIR_IMAGE . $image_old) > filemtime(DIR_IMAGE . $image_new)) {
$this->log->write('Image original newer, recreating: '.DIR_IMAGE . $image_new);
}
Code: Select all
if (!is_file(DIR_IMAGE . $image_new) || (filemtime(DIR_IMAGE . $image_old) > filemtime(DIR_IMAGE . $image_new))) {
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
Users browsing this forum: No registered users and 405 guests