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

Include cache_suffix tinymce parameter in project's static files #465

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Pantzan
Copy link

@Pantzan Pantzan commented Apr 17, 2024

This PR aims to integrate Tinymce's cache_suffix parameter into Django-tinymce.

The problem:
In project deployments it is a common practice to cache static data for long period of time in both proxy (such as Nginx) and browser storage. When a new version of tinymce or django-tinymce is deployed browser cache cannot be cleared on Nginx request. Tinymce includes the cache_suffix setting to solve this problem by appending a url parameter as suffix, for example ?ver=6.8 in each file in order to force the browser to refetch the static files. When the setting is set in TINYMCE_DEFAULT_CONFIG the suffix is not propagated in the compressor nor the init_tinymce static files.

I believe it is useful feature to be included in this project. Dealing with broken forms is a headache after a new release.

If you have any questions or you would like to discuss it further, I will be happy to participate

@Pantzan Pantzan force-pushed the include-cache-suffix-parameter-to-project-static-files branch from 1830e21 to cf647d0 Compare April 17, 2024 13:40
@Pantzan Pantzan marked this pull request as ready for review April 17, 2024 13:41
@claudep
Copy link
Contributor

claudep commented Apr 17, 2024

My feeling is you are re-implementing https://docs.djangoproject.com/en/5.0/ref/contrib/staticfiles/#manifeststaticfilesstorage functionality.

@Pantzan
Copy link
Author

Pantzan commented Apr 17, 2024

We looked up the ManifestStaticFilesStorage. Although with more work the storage can be implemented in global Django space, it will require additional logic to format only the tinymce files if that is the case. We already tried the storage class but it ended up quite hacky and messy so we locally edited this project to complete the migration from tinymce 5 to 6.

I believe as business logic since tinymce offers the cache suffix that should be also propagated into the project's files.

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

Successfully merging this pull request may close these issues.

2 participants