ethersphere / swarm

Swarm: Censorship resistant storage and communication infrastructure for a truly sovereign digital society
https://swarm.ethereum.org/
GNU Lesser General Public License v3.0
489 stars 112 forks source link

Files from a Feed are cached by browser #2213

Open alsakhaev opened 4 years ago

alsakhaev commented 4 years ago

I store static web-page with index.html file and related resources (js, css etc.) in the feed. After uploading a new version of the site, my users don't see it until they hard refresh page with cache cleaning in browser. I suppose, there is a bug in your cache-control response headers. It returns "cache-control: max-age=2147483648, immutable" header, but files in a feed are mutable.

Expected behaviour

Files in a feed must not be cached in browsers. The gateway doesn't return caching HTTP-headers for files in a feed.

Actual behaviour

The gateway returns "cache-control: max-age=2147483648, immutable" header for files in a feed.

image

Steps to reproduce the behaviour

Open any feed URL. I work with this: https://swarm-gateways.net/bzz:/273cd5834517427149d4141400fb79db8ff446f4cf1c96ed5fca51d92ad4b5d1/

acud commented 3 years ago

@alsakhaev @ethernian I've PRed a change to remove the header altogether from the response.

We are moving away from the swarm codebase towards our new client bee. You are advised to switch your applications to the new client.

ethernian commented 3 years ago

@acud , any progress on this issue? please note, the bug wasn't reported against any client, it is about https://swarm-gateways.net. We need either gateway or swarm JS client (if any available)

Eknir commented 3 years ago

Hi @ethernian and @alsakhaev,

Thanks for your involvement here. As @acud mentioned, we are moving away from the old swarm-client, including the gateway to that network. The new gateway is found at gateway.ethswarm.org.

With respect to the Swarm JS client, we are pushing strong for that, from our side. A team has started with the planning. I am sure that for them, your feedback on how you want to use the libraries would be extremely valuable.

You can join the conversation at beehive.ethswarm.org, in particular the #Swarm Javascript channel.

Hope to see you there!