Hello, I think that by including the Cache-Control tag in the metadata pointing to no-cache as specified in this document should help us to avoid this https://cloud.google.com/storage/docs/metadata#cache-control Could you please try this and let us know if this stopped the caching?
On Wednesday, November 18, 2020 at 9:44:51 AM UTC+1 [email protected] wrote: > Hi Elliot, thank you very much for your support. > > Actually, it is not easy to isolate a pece of code to reproduce this > scenario but, as far as I could find, it looks the behavior is like CDN > caching, explained here: > https://cloud.google.com/cdn/docs/caching > > Specially, the part which talks about static files: > https://cloud.google.com/cdn/docs/caching#static > > This is exactly the behavior I'm observing in my AppEngine service, I > mean, I see how "application/pdf" responses are being cached. However, in > case of CDN you can invalidate cache, but I don't know how to do that in > AppEngine. > In my service, it is true that the request > "/retrievedocument?document_id=abc1234def5678" returns an > "application/json", however, I don't want it to be cached. > > My understanding is that this would happen with all GET request which > return "text/css", "application/javascript", "font/woff2", "image/jpg", > "image/png", "video/mp4", "image/mpeg", "audio/mp4" and "application/pdf", > according to CDN's documentation. > > So, does anyone know how to avoid this? > > Thank you very much. > Kind regards, > Iñigo. > > El martes, 17 de noviembre de 2020 a las 20:52:00 UTC+1, Elliott (Cloud > Platform Support) escribió: > >> Hello, >> >> I think the first thing to do is recreate your scenario. Would you be >> able to provide functioning code to do so? >> >> On Tuesday, November 17, 2020 at 9:29:49 AM UTC-5 [email protected] wrote: >> >>> Hi everyone! >>> I would like to expose a problem I'm facing with AppEngine services. >>> I have a Python application, based on Rest services. >>> I have one service which is in charge of upload a document and store it >>> into a Cloud Storage bucket, create and identifier and store such >>> identifier in a database, >>> For example: >>> POST /uploaddocument >>> Request body: >>> { >>> "base64document":"base64_encoded_document" >>> } >>> Response: >>> { >>> "document_id":"abc1234def5678" >>> } >>> >>> Now, I have another service which retrieve such document from the >>> storage, like this: >>> GET /retrievedocument?document_id=abc1234def5678 >>> This service returns an "application/pdf" mime type. >>> >>> For the moment everything works perfect. However, if I upload a new >>> version of this document, the service "/retrievedocument" returns the old >>> version, like if it would be cached, and request is not being processed by >>> my service because I don't see any logs about this request. It is like this >>> request would being served by a CDN or something like this, not by my >>> application. >>> In addition, if I wait some time (more than an hour) then the request is >>> again processed by my application and return the correct version of the >>> document, like if cache would be expired. >>> >>> I would like my service to be returning always the latest version of the >>> document, not a cached one. >>> >>> Have anyone of you faced this kind of problem any time? >>> Does anyone know how to solve it? >>> >>> Thank you! >>> >>> Kind regards, >>> Iñigo. >>> >> -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/120f24a7-2c46-4af0-9297-6db8e9db9726n%40googlegroups.com.
