Commit Graph

21 Commits

Author SHA1 Message Date
Toby Lawrence
77343df0d9 [PERF-224] Support to serve static assets from a CDN.
A base URL can now be configured which is, potentially, prepended to an
asset URL.  This allows a CDN, or caching server, to front static asset
requests, taking load off of the contentstore and speeding up page load
times.

Asset URL generation respects locked vs unlocked assets, and will not
generate links to locked assets that would traverse a CDN (even though
the authorization component of the contentserver middleware wouldn't
allow those links to work anyways).
2016-01-05 10:24:44 -05:00
Calen Pennington
64f3229ce0 Fix tests revealed to be in error by autospec. 2015-09-29 09:30:38 -04:00
Ned Batchelder
60c2e45fbc Added autospec=True to mocks being used incorrectly.
The tests now fail!
2015-09-29 06:56:30 -04:00
Akiva Leffert
66f41e1d9f Make static URLs absolute in handouts, updates, and about for mobile API
JIRA: MA-147
2014-12-03 16:25:48 -05:00
christopher lee
b89113e114 Revert "Make static URLs absolute in handouts, updates, and about for mobile API"
This reverts commit fb6579abfdb6fc9fb8bc9233554ff5c6e9215659.
2014-12-03 16:24:27 -05:00
Akiva Leffert
1088855d0b Make static URLs absolute in handouts, updates, and about for mobile API
JIRA: MA-147
2014-12-03 16:18:39 -05:00
Sarina Canelake
20e2ee9a57 s/pylint: disable=E0611/pylint: disable=no-name-in-module/ 2014-12-01 11:22:09 -05:00
Calen Pennington
cfcbdc0145 Move to OpaqueKey implementations from the external library
[LMS-2757]
2014-05-29 17:03:35 -04:00
David Adams
384bac2f0e Parse urls with query params for ^/static
Query params with a value that starts with /static should have their values converted to the full location.
  Query params with a value that does not start with /static should be left unchanged.
2014-05-28 10:21:55 -07:00
Calen Pennington
e2bfcf2a36 Make course ids and usage ids opaque to LMS and Studio [partial commit]
This commit updates common/djangoapps.

These keys are now objects with a limited interface, and the particular
internal representation is managed by the data storage layer (the
modulestore).

For the LMS, there should be no outward-facing changes to the system.
The keys are, for now, a change to internal representation only. For
Studio, the new serialized form of the keys is used in urls, to allow
for further migration in the future.

Co-Author: Andy Armstrong <andya@edx.org>
Co-Author: Christina Roberts <christina@edx.org>
Co-Author: David Baumgold <db@edx.org>
Co-Author: Diana Huang <dkh@edx.org>
Co-Author: Don Mitchell <dmitchell@edx.org>
Co-Author: Julia Hansbrough <julia@edx.org>
Co-Author: Nimisha Asthagiri <nasthagiri@edx.org>
Co-Author: Sarina Canelake <sarina@edx.org>

[LMS-2370]
2014-05-07 12:54:49 -04:00
David Adams
20f1feb7b1 Fix for static path parsing
When a url contains a query parameter it gets incorrectly parsed
when replacing the /static portion.

This fix handles urls with query parameters.
2013-10-25 13:02:29 -07:00
Jay Zoldak
c8949b99d1 Disable pylint violation E0611 when importing assert_* methods from nose.tools
Cleaned up files with muliline imports

Cleaned up files that do not use these imports

Misread comment
2013-08-27 16:21:33 -04:00
Chris Dodge
5298f54f4c fix tests 2013-08-15 22:58:02 -04:00
Victor Shnayder
3ccb33c8b3 Simplify, make it actually work.
- regexp was too complicated, didn't work
2013-02-11 17:50:13 -05:00
Victor Shnayder
2dcdeff4b6 Make replace_static_urls leave alone urls that have '?raw' at the end
- needed for GWT'ed modules that rely on the filename to find dependencies
2013-02-11 17:07:15 -05:00
Victor Shnayder
92eb88d464 Merge pull request #1444 from MITx/feature/cale/dev-staticfiles
Make local dev work by trying checking staticfiles_storage for both the ...
2013-02-06 14:02:04 -08:00
Calen Pennington
cfae1cdf62 Pep8 autofixes 2013-02-06 11:13:50 -05:00
Calen Pennington
2302b40022 Fix static_replace tests 2013-02-06 10:33:36 -05:00
Calen Pennington
0350d15e29 Make static_replace fall back to data_directory prefix, if it doesn't find the file anywhere else 2013-02-05 11:06:46 -05:00
Calen Pennington
8592db92bf Add more tests of static_replace 2013-02-05 11:06:46 -05:00
Calen Pennington
f1f2bd8fd2 Start adding tests for static replacement 2013-02-05 11:06:46 -05:00