Skip to content

How to get updated .js files (browser cache question) #25

@githubkoma

Description

@githubkoma

Hey There,

didnt know exactly where to put this question, but its related to this tutorial as i used this as a basis to start developing a nextcloud app..

After several changes and versions of the app, i often have the problem that webclients dont get the updated .js files..

lets say i have an additional js file: <script src="/nextcloud/apps/notestutorial/js/notestutorial2.js"></script>

Usually there is the way to add the following in the html header, e.g.:
<script src="/nextcloud/apps/notestutorial/js/notestutorial2.js?v=2019090212345"></script>

This "should" act as some kind of cachebuster to force the client to load the newest .js files from the server.. But that style is not supported with the nextcloud app framework.

Here is the way this is declared in Nextcloud App Framework main.php:

<?php
script('notestutorial', 'notestutorial');
script('notestutorial', 'notestutorial2');
?>

How can i achieve my goal to let the users get the updated js files (and html..) after the nextcloud app was updated via increasing the version number in info.xml?

I'm thankful for any hint :-)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions