On 27 May 2012 04:11, Sergiu Dumitriu <ser...@xwiki.com> wrote:
>
> Some resources that you can use:
>
> https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwiki-platform-cache/xwiki-platform-cache-api/src/main/java/org/xwiki/cache/CacheManager.java
> is the proper way of creating caches. You declare an @Inject dependency on
> that, then use the createNewCache method (if you don't plan on running a
> cluster, or don't think that the cached resources should be shared inside a
> cluster, then it's slightly better for performance to call
> createNewLocalCache). You can then use this cache to store some entries.
>
> https://github.com/xwiki/xwiki-commons/blob/master/xwiki-commons-core/xwiki-commons-environment/xwiki-commons-environment-api/src/main/java/org/xwiki/environment/Environment.java#L44
> is going to give you the location of the temporary storage directory.
> Combine this with
> https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/TempResourceAction.java
> and you have a nice way of serving image files stored on the disk to the
> HTTP client. Unfortunately, this way you have to implement your own LRU
> functionality and make sure you clean up files, otherwise you'll keep
> filling up the disk with temporary files.

That's brilliant - thanks for those, I'll go and do some reading now.

Paul.
_______________________________________________
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users

Reply via email to