-
-
Notifications
You must be signed in to change notification settings - Fork 563
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
Add version param to PublicUrl in FileStorage #2061
Comments
Hi there! The public URL used to retrieved an asset is not proxied through any code from Piranha, the storage providers we provide The cache code you're referring to handles server-side caching of the model class which (like you noticed) won't affect the browser cache for images. The easiest way to deal with this problem would probably be to append a query string parameter to the URL of your asset, like Please note that if you're using a CDN that caches all assets this has to be configured properly as well. Regards |
Thank you for a detailed response! Unfortunately, I cannot change the path in any way or I would need to change the content in blocks for each appearance. Can't I extend A server-side ASP.NET solution for this is probably completely out of scope for Piranha, but maybe you'd know how it might be done from the top of your head? |
Hi again! Sorry for the slow response here. This is the code in the file storage that is responsible for creating the public url If you want a quick fix you can just copy this project, make your own version of the file storage provider and register this in your application instead. I'll add this as a feature request to the included provider as well for the upcoming release. |
Syntax for setting this up in application startup will be:
|
Thanks, turns out in my case there was no real issue, since, I think, etag is handled by a browser when a new file is uploaded and accessed via the same URI. I tried hacking with Nginx to add no cache on I'm glad something for improvement came out of this, though! Thank you for your responses. Maybe even some sort of a configuration for which separate files to set |
Hello,
I came across an issue with file updating.
I have a website that saves and serves files like doc, pdf, docx and etc. into local storage.
Using
Piranha 10.3.0
.Steps to reproduce:
details
of any editable file inMedia
, like a.docx
, maybe even a.txt
would work.URL
(notDownload
)Update
tab of the file, upload the changed file.Download media
link - downloaded file is actually changed, works as expected.URL
- returns the previously cached downloaded version.I have custom blocks with
Tiny
editor that link to the file. I don't know if there is a way to serve such files, only with a link to the file in the blocks.It does not matter if I add or remove inside of
AddPiranha
:that is
PiranhaServiceBuilder
.Changing cache level also does not do anything here:
the result is the same. Is it even a
Piranha
issue?I noticed #502 but the requirement is that the link should stay the same. So no version appends or anything.
Tested on Edge and Firefox.
The text was updated successfully, but these errors were encountered: