Thread: Major Additions - Links and Downloads Manager
View Single Post
  #532  
Old 10-25-2006, 06:37 AM
AndrewD AndrewD is offline
 
Join Date: Jul 2002
Location: Scotland
Posts: 3,486
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by EasyTarget
I recently moved all the files off of the server I'm hosting on to a remote url which I also own. If I use the ldm to download the file my speed is MUCH slower than if I link to the file in my browser. (I'm not talking about the time for the download to start, I mean the duration of the entire download). Is there a way to avoid this? it counteracts the whole reason I moved the files.

I wondered if you'd find this. It's all explained in the wiki, but probably lost in the annals of time.

If you set up LDM with all the (default) security settings turned on, then you've told LDM to keep the file location hidden from the end user. To do this securely for 'downloads' (i.e. files with filetypes that appear in your VB attachments table), it reads the file a block at a time and then transfers these blocks to the user.

This process is:

a) very quick if the file is on the same server as LDM and is referenced just using a local filename
b) slow and expensive if the file is on another server, because the code has to physically read the file over the internet and then retransmit it to the user - everything goes over the internet twice
c) somewhere in between if the file is actually on the same server but is referenced using a full url rather than a local filename.

I 'guestimate' that there is a factor of 1000 difference between case a and b.

When you simply type the url into the browser, then the file is obtained directly from the server on which it is held. There is no need to buffer the file somewhere, and there is also no need to involve a php script in the transfer - everything is dealt with by Apache/IIS/etc, which are 'hard coded' for efficiency.

Now, you can tell LDM to behave the same way as Apache, by setting LDM/admin/settings/force_redirect to 1 or 2. This will recover the speed, but it will no longer guarantee that the file location is secure from prying users. Case 2 is the most visible. Case 1 is partly hidden, but the really inquisitive user can discover where the file is held. Case 0 is fully secure at the cost of slow speed and extra cpu and double bandwidth.

Incidentally, if the file type is not in the VB attachments table, LDM always behaves as if force_redirect = 1

So this is the choice you have to make.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01703 seconds
  • Memory Usage 1,765KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete