#19 ✓hold
Samuel Williams

Use ln -s for plugin assets on OSs that support it

Reported by Samuel Williams | June 10th, 2008 @ 07:36 AM

Why doesn't engines use ln -s for plugin assets rather than copying them on OSs that support it? It would be much easier for a number of reasons - faster start up, less wasted memory, and editing css and js would be much easier too!

James, what do you think of this?

Comments and changes to this ticket

  • Elijah S

    Elijah S July 5th, 2008 @ 07:33 AM

    • Tag set to feature, public_assets

    For what is is worth, I think this would be awesome.

  • Samuel Williams

    Samuel Williams July 15th, 2008 @ 05:05 AM

    Yea, i think it would be a great idea..

  • James Adam

    James Adam October 24th, 2008 @ 02:04 AM

    • State changed from “new” to “hold”

    I think this would be good, but it's not a priority for me. I'd be more than happy to commit an appropriate patch, though, as long as it was clearly implemented.

  • James Adam

    James Adam October 24th, 2008 @ 02:40 AM

    • no changes were found...
  • Samuel Williams

    Samuel Williams October 24th, 2008 @ 11:18 AM

    I've had a look at implementing this feature but there are a number of things to consider:

    • Using symlinks might pose a security risk:
      • Access outside the public directory may
      • Apache has separate permissions that might need to be set for serving the files (i.e. Options +FollowLinks or whatever it is - I actually have no idea of the top of my head)

    However, that being said, having an option for doing it in development mode might be a great idea.

    The problem we are trying to address in my mind is making development of plugin assets easier.

    A patch for this may look like the following: - In development mode, files are symlinked. - In production mode they are copied.

  • James Adam

    James Adam October 24th, 2008 @ 12:10 PM

    The security issue was why I didn't implement assets with a symlink to begin with.

    I wonder if thinking about symlinking is hiding the real problem, which for me is updating the assets without having to restart the server. If this is the case, we should tackle that problem directly, rather than look at OS-specific solutions.

    This should be relatively easy to solve - hooking asset mirroring up with Dispatcher.to_prepare, rather than plugin load, for example.

    What think ye?

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

The rails engines plugin itself

Shared Ticket Bins

People watching this ticket