-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
perf: provide option to query asset using storage default url or through the LMS #100
base: master
Are you sure you want to change the base?
perf: provide option to query asset using storage default url or through the LMS #100
Conversation
…gh LMS This was provided as proxying assets through the LMS can be slower than directly accessing from external storage The default value will be to proxy assets through the LMS as it is more reliable
2060ed7
to
e6f8fda
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Danyal-Faheem for looking into it. I have a suggestion.
@@ -420,14 +383,20 @@ def extract_package(self, package_file): | |||
def index_page_url(self): | |||
if not self.package_meta or not self.index_page_path: | |||
return "" | |||
|
|||
if not self.xblock_settings.get("DEFAULT_STORAGE_URL", False): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should use S3_QUERY_AUTH setting to determinse whetere we should serve static assets vis lms or not. because this setting is used for signing urls in case of private bucket.
if not self.xblock_settings.get("DEFAULT_STORAGE_URL", False): | |
if self.xblock_settings.get("S3_QUERY_AUTH",True) |
@@ -55,43 +55,6 @@ def _(text): | |||
@XBlock.wants("settings") | |||
@XBlock.wants("user") | |||
class ScormXBlock(XBlock, CompletableXBlockMixin): | |||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why we need to remove this docstring?
@@ -106,6 +106,19 @@ This should be added both to the LMS and the CMS settings. Instead of a function | |||
Note that the SCORM XBlock comes with extended S3 storage support out of the box. See the following section: | |||
|
|||
Default storage URL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This additional setting is not needed we can rely on S3_QUERY_AUTH
fixes #99.
A change was introduced in #91 where instead of accessing the url method on the storage backend, we would proxy the assets through the LMS. This was done to generalize the backend and allow for it to work out of the box with external storages such as S3.
However, as pointed out in #99, this can lead to some degraded performance as compared to just accessing scorm files directly from an external storage. Hence, we provide an option to change this behaviour and it is up to the user to choose them.
The default option will be proxying through the LMS as it does not require any extra setup.
An important concept necessary here is that the
url
method must be defined on the storage if theDEFAULT_STORAGE_URL
option is set to true.