Jump to content

Is there an official documentation that describes what will be deleted when we click on clear cache button ?


MaXi32

Recommended Posts

I'm on prestashop 1.7.6.5, if I click on the clear cache button from the backend, I read from a website here  , it said that in prestashop 1.7 I can simply delete /var/cache folder to clear cache but what about the other cache files in /cache/smarty/ ?

Then the other website here said, I can delete the following:

/cache/cachefs/
/img/tmp/
/themes/your_theme/cache/
/cache/smarty/compile/
/cache/smarty/cache/

But it doesn't say about /var/cache folder.

So what is the official description, when I click on clear cache button what files are being deleted in prestashop 1.7.6.5 ? I need this information to create a script to delete the cache folder manually.

Edited by arafatx (see edit history)
Link to comment
Share on other sites

Find functions in:

./classes/Tools.php

./calsses/Media.php

Tools::clearSmartyCache();
    Tools::clearXMLCache();
    Media::clearCache();
    Tools::generateIndex();
Edited by Guest (see edit history)
Link to comment
Share on other sites

24 minutes ago, Guest said:

Find functions in:

./classes/Tools.php

./calsses/Media.php


Tools::clearSmartyCache();
    Tools::clearXMLCache();
    Media::clearCache();
    Tools::generateIndex();

I can see some other functions like clearSf2Cache in the Tools.php as well, to simplify what your described above to end users without having to go deep into the source code, what are the folder structures that will be deleted? because end users are interested with the documentation. Thank you.

Edited by arafatx (see edit history)
Link to comment
Share on other sites

There is a comment above each function.
e.g. Clear Symfony cache.

 /**
     * Clear Symfony cache.
     */
    public static function clearSf2Cache($env = null)

 

Link to comment
Share on other sites

I will definitely not write all the documentation, I am not a paid developer of Prestashop.
Unfortunately, it is not possible to describe all functions in the official documentation.
The developer can always advise and find comments on functions and orient himself in the code.

Describe everything you need is a few pages.

 

http://doc.prestashop.com/display/PS17/Performance

Edited by Guest (see edit history)
Link to comment
Share on other sites

15 minutes ago, Guest said:

I will definitely not write all the documentation, I am not a paid developer of Prestashop.
Unfortunately, it is not possible to describe all functions in the official documentation

That is exactly what I don't want you to do. Please do not misunderstand my question. Because all I need is the documentation regarding to simple folder structures that are being deleted like what the other websites are describing like this (this is taken from https://presta.site/blog/en/how-to-clear-prestashop-cache/ :

screenshot.thumb.PNG.04cd3c5a07e3b53454a32bfdedf7fffe.PNG

but the above description is not official from prestashop. So, I need the official documentation as end users without having to go through the codes.

I understand that source codes are linked to the Symfony cache tool, so I have no time to go through with that, that's the reason I'm requesting a documentation about the folder structure that are being deleted. Maybe prestashop developers know exactly what I mean here.

  

16 minutes ago, Guest said:

Describe everything you need is a few pages.

 

http://doc.prestashop.com/display/PS17/Performance

The documentation in the given link doesn't describe in technical about what folders are being deleted.

Edited by arafatx (see edit history)
Link to comment
Share on other sites

I just created this script here to detect file changes, so i monitored prestashop folder, within 3 hours right now, when I enable cache together with CCC and when I click clear cache,

I can see the only files in folder that are being created and removed are only at this location:

1) /var/cache/

So, this raises my question about the other cache folder that don't have any file activities like:

/cache/cachefs/
/img/tmp/
/themes/your_theme/cache/
/cache/smarty/compile/
/cache/smarty/cache/

When do they get generated ?

 

Hopefully someone can describe this for prestashop 1.7.6. what are the folders that can be safely (officially) deleted (which cache or temps folders) ?

Edited by arafatx (see edit history)
Link to comment
Share on other sites

Deleting content (subfolders and files) from ./var/*, ./cache/*, ./img/tmp/* folders reduces it by a maximum of 50 MB (4000 products).

Other folders must be kept.

Link to comment
Share on other sites

7 hours ago, Guest said:

Deleting content (subfolders and files) from ./var/*, ./cache/*, ./img/tmp/* folders reduces it by a maximum of 50 MB (4000 products).

Other folders must be kept.

OK I just found the answer about the description of folder /cache/ in Prestashop 1.7. When I go inside that folder /cache/* I saw a text file called deprecated.txt and it says the /cache folder is deprecated. So, it shouldn't be used. Meaning, it's worth nothing to delete:

depcrecated.thumb.PNG.602b26a94572047ecdb4ec23ec78cf0f.PNG

 

Link to comment
Share on other sites

2 minutes ago, Guest said:

Yes, it's not worth deleting anything.
The cached files are really small.

I mean it's worth nothing to delete that folder /cache/* which is not used in prestashop 1.7 but only the /var/cache/*. In my case I have over 2.5 GB cache files ^_^ .. That's why it's scary to make daily backup to include that 2.5 GB. Thank you so much for helping.

Edited by arafatx (see edit history)
Link to comment
Share on other sites

21 minutes ago, Guest said:

2.5 GB? Not possible. 😅

Believe me. it is possible and I'm not sure if this cache issue has bug or not. and some people are reporting the same thing like this 2GB cache per day: 

and this person has 11GB cache:

this is my old cache folder few months ago which get into the auto backup archived ( 1.6 GB ) if I didn't manually delete it. The latest size is 2.5 GB ++ :

cache-old.thumb.PNG.2312b0020619ad8418ca205311aef159.PNG

Edited by arafatx (see edit history)
Link to comment
Share on other sites

3 hours ago, musicmaster said:

You can save even more when you only backup the base product images (like 123.jpg). You can always regenerate all the derived image formats

That's a very useful tip.

Link to comment
Share on other sites

On 7/3/2020 at 3:07 AM, musicmaster said:

You can save even more when you only backup the base product images (like 123.jpg). You can always regenerate all the derived image formats

ive always been unsure how the /img/ directory is created and used in Prestashop. My 1.6 site shows an image the site actually uses is in really odd directory locations /img/5/6/5/556.jpg

Do you have to have them in these locations or is there a way to tidy this up -  ie to 'regenerate all the derived image formats' - not really sure what this is?

Can you help?

Link to comment
Share on other sites

3 hours ago, bnadauld said:

ive always been unsure how the /img/ directory is created and used in Prestashop. My 1.6 site shows an image the site actually uses is in really odd directory locations /img/5/6/5/556.jpg

I think the base image is like 123.jpg and the image for thumbnail (non-base image) are like:
 

123-cart_default.jpg
123-medium_default.jpg
123-thickbox_default.jpg

each folder has its own category (in prestashop 1.7):

example:

public_html/img/c/123.jpg = image for category
public_html/img/p/123.jpg = image for product
public_html/img/s/123.jpg = image for shipping logo

  in prestashop 1.6 I think this is the answer: 

 

3 hours ago, bnadauld said:

Do you have to have them in these locations or is there a way to tidy this up -  ie to 'regenerate all the derived image formats' - not really sure what this is?

Can you help?

You can regenerate the thumbnail images at: Design - > Image Settings -> Regenerate thumbnails, so if you accidentally deleted the thumbnail image 123-cart_default.jpg (or just to save space for backup), then you can regenerate here.

Edited by arafatx (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...