Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache bust API urls #325

Open
maximz opened this issue Nov 28, 2016 · 0 comments
Open

Cache bust API urls #325

maximz opened this issue Nov 28, 2016 · 0 comments

Comments

@maximz
Copy link
Member

maximz commented Nov 28, 2016

We should be able to cache bust API URLs to force clients to update cached versions of content. For example, when we rewrote schedules in #323, it would have been ideal to cache bust the entire courses API and all schedules.

The change would be made in CourseService.ts. Specifically, the url in this function:

    public getBySemester(termCode: string) {
        return this.$http.get(CourseService.API_URL + termCode, {
            cache: true
        }).then((response) => {
            return response.data;
        });
    }

should get a +'?v'+cache_num or something like that. This cache_num should be stored somewhere and incremented by a bust_client_cache management command. cache_num can be injected into index.html somewhere for us to pick up, since that page is never cached as it's only seen by logged-in users.

(Currently the only such thing we do is we manually have set ?bust=v4 in index.html and config.ts for loading core javascript static resources. This does not include API calls.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant