I'm working to a site for cloud file management with CakePHP, where user can upload numerous files like images, documents, pdf etc. and all those uploaded files will be in aws s3 bucket, nothing in local.
These document will be load using jstree ie. when user click on a jstree folder corresponding documents of that folder will load in view via AJAX.
Now the problem is that, its taking a huge amount of time to load corresponding files of a folder when there are numerous files. For example: I've a folder with 50+ images and also with some doc files. When I select that folders it takes couple of minutes time to load that folder and every time it takes that amount of time.
I already used cache for that ajax loaded view and also set cache : true
in jquery ajax setup to that view file.
Something like:
public $cacheAction = array(
'index' => 36000,
'ajax_documents' => 3600 // this is the view file that render documents
);
.....
public function ajax_documents() {
// Here is all query data that set to corresponding ajax_document.ctp file
// I also cached the query result for each folder request
}
And in jQuery
$.ajax({
type: 'GET',
cache: true,
ifModified: true,
data : {},
url: '..ajax_documents',
......
});
But nothing is working. Still it takes huge amount of time to render ajax_document.ctp
. File caching is working properly cause I'm seeing them.
So in this situation I need your help and suggestion how to boost up this loding and what is best way to follow for this kind of situation?
NOTE:
The Main problem is the loading of images from s3 on each time view load. So I need basically the solution for that image cache.
Please help me with this.