I am pretty frustrated with this. I tried using a glob var instead of a session var but it doesn;t work either. Here is the decl
$GLOBALS['iUploadImage']=0;
class Configure extends CI_Controller
{
and here is the test
if ($GLOBALS['iUploadImage']==0) //check to see if already transferred
{
$this->MyModel->get_image(); //gets images from s3
$GLOBALS['iUploadImage']=1; //the files have been transferred
}
This downloading reoccurs everytime a user clicks to a new page. Actually not a new page since this is a single page app.
I want to download the images only once. It would have been much easier if I just saved the thumbnail in mysql. I wanted to also keep the full image so that users could access it years later, but I am running out of patience with the issue with that.
I am using AWS transfer to download the images. The reason I went to S3 at all was the size limitation on MYSQL. While Koolreport can use images directly from mysql, it can't use them from S3. S3 is a much cheaper way to keep large files.
I am considering reworking this area (ugh!) and keeping the thumnails up on MYSQL, and only download the actual file when a user asks for it.
This speed issue is killing my app.
proof that an old dog can learn new tricks