Mybb: JS versioning

Created on 15 Nov 2017  路  7Comments  路  Source: mybb/mybb

The way that JS is versioned inside templates at the minute is to manually update the version ?ver=XYZ in templates. This is error-prone and time consuming.

Frostschutz suggested instead adding something like ?ver={$mybb->version_code} (example name), with the version code being automatically updated on upgrade: https://community.mybb.com/thread-214063-post-1288791.html#pid1288791

This would save quite a lot of effort for developers of the core and theme authors (see the rest of the above linked thread for more details).

1.9 enhancement

Most helpful comment

A tool for bumping the timestamp could also come in handy.

All 7 comments

+1 馃懟(the ghost is my +1)

Agreed.

How about a one time hash that is generated on each install/upgrade? That way there is no disclosure of the version number in the source code. Needless to say that this would be a great improvement regardless.

A one time hash sounds like a good plan. Easiest version would be the install/upgrade timestamp which shouldn't be too sensitive.

A tool for bumping the timestamp could also come in handy.

This is going to be a good thing.

The straight forward approach, imho is to detect the last modified timestamp of the file and use that stamp for versioning. filemtime() may come handy for this.
Also we should version the css files same way. We already are capturing the 'lastmodified' stamp in database which we can use for css versioning.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Ben-MyBB picture Ben-MyBB  路  5Comments

Ben-MyBB picture Ben-MyBB  路  7Comments

Ben-MyBB picture Ben-MyBB  路  4Comments

LogicPlague picture LogicPlague  路  5Comments

woostarUK picture woostarUK  路  4Comments