I want to add a parameter at the end of the static content urls, but i am unable to find a global method where i can make a change and it starts reflecting on the all static content urls.

My file and code where i tried making the changes:

File path: vendor/magento/framework/View/Asset/Repository.php

code that i tried to modify:

public function createAsset($fileId, array $params = [])
        list($module, $filePath) = self::extractModule($fileId);
        if (!$module && $params['module']) {
            $module = $params['module'];

        if (!isset($params['publish'])) {
            $map = $this->getRepositoryFilesMap($fileId, $params);
            if ($map) {
                $params = array_replace($params, $map);

        $isSecure = isset($params['_secure']) ? (bool) $params['_secure'] : null;
        $themePath = isset($params['theme']) ? $params['theme'] : $this->design->getThemePath($params['themeModel']);
        $context = $this->getFallbackContext(
        return $this->fileFactory->create(
                'source' => $this->assetSource,
                'context' => $context,
                'filePath' => $filePath."?mytest='value'",
                'module' => $module,
                'contentType' => $this->assetSource->getContentType($filePath)

Where "?mytest='value'", is my custom parameter that i want to pass globally for all the static files that load from my pub/static folder through web url.

Example relative url that i want to load for all the static content urls: en_US/Magento_Ui/js/lib/knockout/bindings/bootstrap.js?mytest='value'

1 Answer 1


i found the answer for my above question.

URLs that are created during the page load time are create from the file:


In the method:


Requirejs dependency urls are loaded from the requirejs-config.js file.

I hope this answer helps others looking to modify functionality related to static urls.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.