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

Allow caching of file endpoints #49

Open
irfinnew opened this issue Mar 23, 2017 · 2 comments
Open

Allow caching of file endpoints #49

irfinnew opened this issue Mar 23, 2017 · 2 comments

Comments

@irfinnew
Copy link

We now disabled caching of everything /api/ (see T6850), but that includes things like /api/logo/5/image/. This may negatively impact performance.

Ideally, we'd use aggressive caching for such things, and change the URL when the image changes. Maybe /api/logo/5/image/X/, where X is an incrementing serial, a hash/checksum, a timestamp, whatever.

@SpaceK33z
Copy link
Contributor

The caching of images is essential if you load a couple of them in one page, e.g. for REX the performance without caching was disastrous on the dashboard (we have many contact avatars).

What we did there was something like this: api/contact/2/image/3/, where the 3 was the ID of the file. In the contact API it would have a image_url property, which would look like "image_url": "api/contact/2/image/3/".

@irfinnew
Copy link
Author

Part of the problem is that under our current setup nginx is told to add no-cache headers to everything under /api/ ;)

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

2 participants