views:

223

answers:

3

I have a few relatively big files (Flash movies) which I want to serve. Where should I put them inside my project? I would like not to export them each time I export the .war file, since they take up a lot of space.

+1  A: 

It's quite common to create two separate projects for this (two war files), and just deploy them side by side. Then you only deploy the large file when required.

krosenvold
Thanks! But then wouldn't I need to still deploy the whole "static" war file (~200 flash video files =~ 400 MB) when I want to update a single file?
noam
A: 

Perhaps a better option would be to deploy them to an external hosting service, such as Amazon S3. It also has a content delivery network named CloudFront, which serves the files from a server close to the user.

They are not free, but they are very cheap.

David Rabinowitz
A: 

You could setup your deployed location with a checkout of the large media files from your versioning system (e.g. SVN, GIT, CVS, etc). Then, configure a recurring task (e.g. cron or Scheduled Task) to perform an update of the checkout to retrieve any changes and grab any updates.

Mads Hansen
That's what I thought of doing, but don't I have to deploy a .war file onto the server?
noam
Yes, you will need to deploy the war with the compiled artifacts. There are a variety of options for how to also deploy the code version system checkout. You could adjust the filters on your build to include the .svn(I'm assuming) checkout folders/files for those particular directories, or you could have an additional set of deployment/config steps to overlay the checkout into the install dirs. Deploying an exploded war will make it easier to manage the deployment.
Mads Hansen
Sorry, but didn't understand where the WAR creation happens. Let me recap what I understood:I have all of my media files under SVN (without any .WAR file). Then when I update a file I check it in. Then on the server side, a cron updates from SVN. so far so good. but where does the war file come in?
noam
Create and deploy your WAR file the same way your would normally do it(e.g. Maven, ANT, etc). Either customize the WAR generation to include the SVN checkout for your large media files(and maybe exclude the actual media files, since you will be fetching them through an update), or have a separate utility to bundle those folders and overlay them onto your install.
Mads Hansen