The following warnings occurred:
Warning [2] Undefined array key "threadviews_countguests" - Line: 745 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/showthread.php 745 errorHandler->error_callback
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/inc/functions_post.php 830 postParser->parse_message
/showthread.php 916 build_postbit
Warning [2] Undefined property: MyLanguage::$thread_modes - Line: 46 - File: showthread.php(1650) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/showthread.php(1650) : eval()'d code 46 errorHandler->error_callback
/showthread.php 1650 eval




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Make version query parameter optional
#1
When registering a Stylesheet or Script (register_style, register_script functions), can the "v=" query string be omitted from the generated html if the version parameter is blank or otherwise not provided?

Apparently, while successfully cache busting, it can block caching completely: http://www.stevesouders.com/blog/2008/08...erystring/

I prefer automatically embedding the file date into the name, then use .htaccess to remove it when requested as per html5-boilerplate's and others advice. This can be be done conveniently with a small .htaccess file in the template folder.

Example from my template functions.php:
Code:
register_style(TEMPLATE . '.site', self::autoVer($theme_url . '/css/theme.min.css'), '', 'all');
 Generates something like:
Code:
<link href="/theme/mytheme.2018/css/theme.min.1527149955.css?v=" rel="stylesheet" media="all">

The "?v=" is not useful.
Reply


Messages In This Thread
Make version query parameter optional - by beejay41 - 2018-07-06, 21:44:09



Users browsing this thread: 2 Guest(s)