Search

I sent a pull request to the JIT repository which should make JIT cache external files based on the Last-Modified header field of the HTTP response header. I hope that the team will review it and consider integrating this functionality.

In the coming days I will play with the S3 Upload Filed in conjunction with JIT. My use case is uploading image files to S3, then creating and caching thumbnails and mid-sized versions using JIT.

I downloaded the latest dev version (0.6.5). I enable it and enter Access Keys, but when I try to create new section or edit an existing one, I simply bet bank white page. Same thing happens with 0.6.4 as well. symphony log file is also empty... I am running symphony 2.2.1.

Never mind my last post. It was a code problem on my end.

Have you tried to use S3 Links with JIT Image Manipulation? I add my bucket url to trusted sites list, but the images won't load...

Have you tried to use S3 Links with JIT Image Manipulation?

Yes, I have managed this (and I have achieved caching of external files in JIT, still waiting for the pull request to be reviewed).

Don't forget the wildcard at the end. The trusted domain should look like this:

bucketname.s3.amazonaws.com*

If you have time, you could help with testing my JIT improvements. You can pull or download my version here: https://github.com/michael-e/jit_image_manipulation/tree/cache-external

Doesn't serving images stored on S3 through JIT negate the use of S3 in the first place? I choose to use it for cheaper bandwidth rather than cheaper storage, so running images through JIT means they are still served from my host.

I only want to serve cached thumbnails (i.e. processed images)! If I would build the thumbnail every time it is called, I would have to load the file from S3 every single time, right? And that is much more expensive regarding bandwith.

Well, yes, but if you're serving cached thumbnails from your server, what is the benefit of storing the original on S3? The real benefit comes from when the thumbnail itself is served from S3. I've had some thoughts about this over the last year or so, so I'll try to write them into something more tangible... there is certainly scope for tighter integration with S3/Cloudfront.

My main reason for S3 is virtually unlimited space. I don't have any performance issues when serving JIT cache files (like your high-performance sites may have). So in short words: I need a big HardDrive for things that are requested as thumbnails by just a few people. :-))

So in my use case my proposal makes perfect sense. And all the work is done already.

Do you have any objections regarding JIT caching external files?

No worries: our needs for S3 are very different (storage space vs. data transfer/performance). If you can solve the former with JIT that's great :-) I'll start a separate thread to discuss the related idea I've had.

Well, I have already sent a pull request for JIT. :-)

Problem solved. It's funny how long you can look at the problem and not notice it... I just forgot to add /1/ to the url. Now everything's fixed. I thought I'd mention though, that JIT doesn't like the {@url} with http://... This is what I use right now.

<img src="{$root}/image/2/960/540/5/1/buckentname.s3.amazonaws.com/{filename}"/>

That looks very similar to what I use. Are you working with my "enhanced" branch of JIT? Can you confirm that it works as advertised when you remove the file, for example? (There is a bug in the current JIT extension which I hope to have fixed on the way.) Can you confirm that caching of external fiels works the way you expected?

I am using the default JIT that comes with symphony 2.2.1. I will download the "enhanced" branch soon and see how it works... How far away, you'd say, is it from to be used in a live environment?

This completely depends on how useful and stable people think it is. :-)

So if you can try it out and post your findings as a comment for the pull request on GitHub, that would be great!

I'd love to use this field but it didn't work with my 2.2.3 install. When I try to edit a section I get this error:

preg_match(): Delimiter must not be alphanumeric or backslash
/srv/www/dev7.eyes-down.net/public_html/symphony/lib/toolkit/class.general.php line 946

941                 or in_array($file, $exclude)
942                 or in_array("$dir/$file", $exclude)
943             ) continue;
944
945             if(!is_null($filter)) {
946                 if(!preg_match($filter, $file)) continue;
947             }
948
949             $files[] = str_replace($strip_root, '', $dir) ."/$file/";
950

Though I can;t see anything specific to the extension in the error, disabling it sorts out the issue, so I think it must be the problem.

Is there any kind of unusual setup I need to do on my S3 instance for this extension to work? I've been trying to get everything sorted on a local dev install of Symphony 2.2.3, but the extension is not doing anything. When I try to upload a file to an empty bucket, I just get the following response from Amazon:

<?xml version="1.0" encoding="UTF-8"?>
<ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
    <Name>static.tonyarnold.com</Name>
    <Prefix></Prefix>
    <Marker></Marker>
    <MaxKeys>1000</MaxKeys>
    <IsTruncated>false</IsTruncated>
    <Contents>
        <Key>logs/</Key>
        <LastModified>2011-10-02T00:36:53.000Z</LastModified>
        <ETag>&quot;d41d8cd98f00b204e9800998ecf8427e&quot;</ETag>
        <Size>0</Size>
        <Owner>
            <ID>1a5baa887d34d9b68a6af585ff287d734a3074f38387b41dce2af3e114955ed5</ID>
            <DisplayName>tony</DisplayName>
        </Owner>
        <StorageClass>STANDARD</StorageClass>
    </Contents>
</ListBucketResult>

Update: Turns out that Symphony 2.2.3 is doing some weird things — I've created a pull request here: Fix uploads when using Symphony 2.2.3.

This is a great idea for an extension but unfortunately I get this error after I install it and try to edit my sections.

preg_match() [function.preg-match]: Delimiter must not be alphanumeric or backslash
    /Applications/XAMPP/xamppfiles/htdocs/simplicity/symphony/lib/toolkit/class.general.php line 950

    945                 or in_array($file, $exclude)
    946                 or in_array("$dir/$file", $exclude)
    947             ) continue;
    948
    949             if(!is_null($filter)) {
    950                 if(!preg_match($filter, $file)) continue;
    951             }
    952
    953             $files[] = str_replace($strip_root, '', $dir) ."/$file/";
    954

S3 Upload Field updated to version 0.6.5 on 8th of November 2011

Hi all,

It looks like Scottkf had pushed some additional updates into bzerangue's original repo in June, so I have modified the link on the site entry accordingly. That repo is here, and might solve the issues you're experiencing if you've been working on my branch.

Last I checked, in June, everything was working. But that wasn't with 2.2.3

@tonyarnold, if you send that pull request to my repo I'll pull it in. I've been working with rails a lot lately, but I'll make some time!

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details