I am using this library https://pub.dartlang.org/packages/flutter_cache_manager#-readme-tab-
and I have 2 questions.
Firstly, it is unclear to me whether the getFile(url) function automatically caches the file that is returned or whether I must call putFile() after it is returned.
Secondly, I see that you can override BaseCacheManager to set a maxAgeCacheObject. Does the OS automatically delete files that have expired or must I make sure they are cleaned.
Thanks for the help :)
ad 1) The getFile(url) method will "automatically" cache the result. The putFile() method is only available to eagerly precache data.
ad 2) Both, You should make sure you have a reasonable upper limit. But since files are stored in a temporary directory which the OS is allowed to delete, the files will be removed if the device runs out of storage. --- FWIW - No, the OS does not remove files which are too old, but the cache manager will remove objects which are older than maxAgeCacheObject. (The OS does not know about how old a file can be, it might start deleting the oldest files first, but there is no guarantee for this.)
Related
I'm using duplicity to the backup web project.
There are three different places that handling by duplicity: storage, DB, and system settings.
I want actually to stop backing up storage and left two others.
So the question is how can I know which cache files related to storage backups and is it safe to delete them (or whole duplicity cache folder), as it takes too much space
UPD:
I've move cache to the new place and change path to cache in configs, after that made few test runs to make that all work fine. Then I've removed an unneeded folder and all the rest backups still work. So it's definitely safe to move/delete cache folder
generally, yes it should be safe. but as we are talking backups, how about safety first?
simply move the folders out of the way,
redo the backups you want to continue (observe the "newly" created folder name under cache)[1]
do a verify to make sure you can restore everything
on success you may delete the old cache folders
done.. ede/duply.net
[1] cache folder name should be a md5 hash of the target url -
http://bazaar.launchpad.net/~duplicity-team/duplicity/0.8-series/view/head:/duplicity/commandline.py#L112
I'm very new to Typo3 and am struggling with a few cached images that refuse to update.
There has to be a option to deactivate all caching somewhere, and to flush everything. I need to know how.
What I have been expecting to find was one button that fixes it all. What I actually found was the following:
The directory /fileadmin/_processed_ contains resized images that the website creates and stores for later reuse, deleting the folder's content prompts the website to recreate everything from scratch, thus reflecting any changes to the original images that are stored elsewhere.
The directory /typo3temp/ runs a similar role like the one mentioned above, it contains semitemporary data from some installed extensions (unlike above not limited to image files). If a particular extension is causing trouble you might find (and empty) it's cache in this directory
/typo3temp/Cache appears to be of interest.
The Install tool accesible from the backend provides a few useful functions, most notably the clear all cache found under the tab important functions.
Furthermore there is a tab clean up which allow clearing cache_imagesizes, cache_md5params, cache_typo3temp_log amongst some other things that don't seem to be of greater interest.
I had the same problem when I switched to TYPO3 6.0
It was caused by the FAL (file abstraction layer).
The only way, displaying a newer verion of the picture was to rename it such like:
oldpicture = _picture
newpicture = oldpicture
I have a problem when I detect accessing folder on Mac in python programming.
I use Pyinotify, watchdog, fsevent to monitor files change, it's very good, but now I need to detect when I access into a folder. I want to know when someone opens up the Finder at a folder so I can check for changes to that folder only
Ex: I'm currently in here folder/
and when I go to folder/folder_children , my python program can know that.
Anyone know how to detect it?
You may want to use Watchman. We provide a (not currently very well documented) python client and it works on Linux and Mac (and Solaris and FreeBSD)
https://facebook.github.io/watchman/
For your use case, the following aspects of Watchman are pertinent:
Watchman builds a time ordered index of file changes
Each logical change has an associated "clock" value
You can query Watchman for the list of files that changed since a clock value
For convenience you can ask Watchman to track a clock value with a symbolic name; we call these named cursors
For example:
When I run watchman since /path/to/dir n:myclient the first time, I get a complete list of files in /path/to/dir. When I run it the second and subsequent times it returns the list of files that changed since the last time it was run.
You can construct more sophisticated queries than since to match certain files; pertinent docs:
https://facebook.github.io/watchman/docs/cmd/since.html
https://facebook.github.io/watchman/docs/cmd/query.html
Architecturally:
On the remote side, run the Watchman service and ask it to monitor the root of the filesystem tree that you're syncing. Watchman always watches recursively.
On the client side, you can periodically (or via whatever heuristic you use to figure out when is appropriate) call up to the server
When polled by the client, the server issues a since query to Watchman using a cursor name
Your server only needs to re-examine the files in that list
You can use a separate cursor name per discrete client if you have multiple clients to synchronize.
I have written an application that uses Isolated storage store data that I want to clear out on a periodic basis when it gets old. I have written a function that is called from Closing that checks the isolated storage for old data and deletes it.
This routine will delete everyfile that it is supose too except the last two files in the directory. When I debug the code I can see it execute the DeleteFile method on those files. I even when as far as checking right after the call to DeleteFile to see if the file still exists. According to the debugger it does not.
Yet when the appication starts up again the old data is for those last files is still in isolated storage. Thinking that it may be a race condition I put a Thread.sleep(1000) after the delete routeines.
The phone does not honor this delay and exits immediately after executing the delte code. I could not find a flush command that would be related to DeleteFile as I don't have a reference to a stream at that point.
Has anyone else found this or something similar? Is there a magic flush method I am missing or is this a defect in the phone IsolatedStorage implementation?
i agree with Matt and Matthieu.
though also wish to ask u have u tried truncating the file?
IsolatedStorageFileStream isfStream = new IsolatedStorageFileStream(strXMLFile, FileMode.Truncate, isf);
Can I create a symlink to the local extension from aonther project folder? I have a common local-server and i need to implement same extension on all local project-installations. I tried to put the symlink, but some times i do not get expected output. I get it only after clearing the cache of that perticular project.
Your scenario is a common one I guess. But as Omar said, linking to the same code base of the extension through several typo3 instances is not a good practice.
But we have the same structure as yours, we realize this through SVN. All of our projects got a SVN repository and common extensions have their own repository. Through svn:externals the extensions are linked into the concrete project. This has the advantage that you can change the extension in the concrete project and after committing all other projects (that do have to update from svn though) contribute from it. I Think this would fit your needs, too.
If I understand your question correctly you have several Typo3 sites on the same server and want to share an extension between them using a symlink. I don't think that is a very great idea because many extensions use tables and every site normally has it's own database so you would have to do a lot of tinkering to get that to work.
Instead you could make all the modifications to the extension files in the typo3conf/ext/extension_name folder and then export the extension to a t3x file (Ext Manager in the Backend). This t3x file can be installed as a extension (Import extension) on all your other sites.
If you extension does not use a database and you are planning to make frequent changes then I guess you should be able to make that work (the symlink). Otherwise I recommend you use the first approach I described.
I have not tried this, but you should be able to install extensions globally in Typo3. What this means is that the given extension is placed inside '(typo3_src/)typo3/ext/' instead of 'typo3conf/ext/', presuming both sites use the same Typo3 Core/Source (and thus typo3_src is a symlink to the location of the core).
You can enable installing global extensions via the Install Tool. Once inside the tool, click on 'All Configuration', then search for allowGlobalInstall. Or put the following line into your localconf.php:
$TYPO3_CONF_VARS['EXT']['allowGlobalInstall'] = '1';
At last, but not least, you need to make sure the 'typo3/ext/' directory is writeable.
Hope this will be to some help. If you have any further questions, let me know :)
As Björn mentioned, I'd sugegst to install them globally. Mind you, updating the source will require to move the extensions accordingly..
As for "expected output": be aware that the code in these folders is cached in various ways (mainly page content and config settings), and hence not always run. This is the reason a change done from "outside" the current installation is likely not to propagate to your output without clearing these caches (as you have observed).
When you actually install an extension via the extension manager, the cache should (if correctly configured) be cleared (interested parties may search for clearCacheOnLoad in class.em_index.php to reveal a clear_cacheCmd('all')). There is a small checkbox, which is normally checked, during the installation process to accomplish this.
Omar's first approach is therefore, as I see it, the more easy way to get "expected output" and less jumbling around with global extensions.