just now ,i found the the folder "image/cache" is over 11G, which i think is too big,as the other part of the website is 2G.
how to stop it become too big?
or is it possible to disable the cache function?
if delete all images in "image/cache" ,they will come back a few days later.
if chmod 555 cache ,the product images will not show at category page
by the way ,i have set "dashboard-the right top gear-theme/sass off",hope it will help.
thanks
my extension:https://www.opencart.com/index.php?rout ... estshop24h
email :support@bestshop24h.com
site:http://www.bestshop24h.com
Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com
Code: Select all
<?php
class ModelToolImage extends Model {
public function resize($filename, $width, $height) {
if (!is_file(DIR_IMAGE . $filename) || substr(str_replace('\\', '/', realpath(DIR_IMAGE . $filename)), 0, strlen(DIR_IMAGE)) != str_replace('\\', '/', DIR_IMAGE)) {
return;
}
/* don't resize, keep using the original image, it's a responsive web theme anyway! */
return $filename;
}
}
Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig
Yeah and in the end you will have a 1280x720 images in the products list of the cart as well as in any other place. This task requires at least a bunch of CSS tweaks whenever you have an image. Let alone, it will load original images for EVERY thumbnail, which isn't very wise.JNeuhoff wrote: ↑Sat Aug 14, 2021 7:51 pmEven with all the cached re-sized image versions of the original ones the client web browser will still dynamically resize them again on many occasions. This is because of using a responsive web theme. Therefore, the easiest way to bypass the image/cache is to only use the original images, be modifying the catalog/model/tool/image.php as follows:
Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com
In practice, we never use images like 1280x720. An image that size would almost fill the whole screen area on most devices.
Using an excessive amount of additional product images for a product is often unnecessary and not good for the site performance. There are things you can do for the client-side browsers, such as lazy-image loading, or client-side image caching. Get the original images down to a more realistic sizes.
Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig
For products alone, the size of your cache folder depends on
1) how many original images you have defined for your products
2) how well your originals have been optimized
3) how many different dimensions you have defined (max 10)
4) how big those dimensions are.
You can delete those cached images but they will be recreated on page request which will slow down that request enormously depending on the amount of product images on the page, resizing images on the fly is a bad idea.
Not resizing the images but instead using the original for all types is also not a good idea, on category pages you will be sending huge amounts of data needlessly.
Of course those images will be browser cached but that cache will only take so much before it flushes.
If you frequently change the dimensions in admin, it will not remove the old images from the cache so you may have some old images in there taking up needless space. So do not change the dimensions too often and if you do, clear out the cache afterwards and run a local spider to re-generate the images beforehand so the customers do not have to during their requests.
If you think 11GB is too big (I don't) you may look at perhaps optimizing your image sizes and using the same dimensions for different types in admin.
PS. SASS has nothing to do with images.
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
How big is image folder after you delete the cached files?
UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk
it is less than 2Gpaulfeakins wrote: ↑Mon Aug 16, 2021 6:53 pmHow big is image folder after you delete the cached files?
my extension:https://www.opencart.com/index.php?rout ... estshop24h
email :support@bestshop24h.com
site:http://www.bestshop24h.com
thanks so much!by mona wrote: ↑Mon Aug 16, 2021 7:55 am
If you frequently change the dimensions in admin, it will not remove the old images from the cache so you may have some old images in there taking up needless space. So do not change the dimensions too often and if you do, clear out the cache afterwards and run a local spider to re-generate the images beforehand so the customers do not have to during their requests.
If you think 11GB is too big (I don't) you may look at perhaps optimizing your image sizes and using the same dimensions for different types in admin.
my extension:https://www.opencart.com/index.php?rout ... estshop24h
email :support@bestshop24h.com
site:http://www.bestshop24h.com
Users browsing this forum: adycobra2003, nonnedelectari, Semrush [Bot] and 141 guests