Should the library version number in the media_library() hook be updated every time the media javascript is altered? It is set to an unchanging "7.x" which means that browsers will not always get the latest media JS (or css) which has the potential to cause all sorts of problems.

CommentFileSizeAuthor
#4 1365888-bust-media-library-cache.patch554 bytesmakangus

Comments

dave reid’s picture

Category: bug » task

I'm not sure. :/

dave reid’s picture

Status: Active » Fixed

Ok, I've committed a change to fetch the version = [x] line from media.info if possible, or otherwise use the branch of the module (7.x-2.x or 7.x-1.x) which is what Drupal core does in it's own system_library().

http://drupalcode.org/project/media.git/commit/a75cf8f
http://drupalcode.org/project/media.git/commit/d10b826

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

makangus’s picture

Issue summary: View changes
Status: Closed (fixed) » Needs review
StatusFileSize
new554 bytes

Sorry to re-open this issue.
It seems like the version is always the same so the cache is never busted or it can take a very very long time depending on the TTL.
Maybe we should keep the version as NULL so the cache is busted when we clear cache in drupal.

Before:
The js libraries are loaded in as media.js?v=7.x-2.x-dev, the version is never changed so the cache is never busted when media.js is updated.
After:
The file is now media.js?n7ubhc and the cache is busted and the cache buster is updated to a different hash when we clear cache in Drupal.

  • Dave Reid committed d10b826 on 7.x-3.x
    Issue #1365888: Use the module version from media.info as the version...
joseph.olstad’s picture

Status: Needs review » Fixed

Fixed a while back, thanks @Devin Carlson

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.