Skip to content

Thruster caches x-sendfile response and gives a 404 on subsequent requests if the file is removed (rails full page caching) #51

Open
@sodonnel

Description

@sodonnel

I have a very old blog I am trying to bring up to Rails 8 with Thruster.

The app uses Rails full page caching, ie:

caches_page :index, :show

On the posts controller. What I have found is that on the first load of the posts index, everything works great - rails writes the cache file into public/posts/index.html. However I think Thruster then caches the static file on the next load.

Later, when I add a new post, the cache gets swept, removing posts.html from the public folder.

At this stage, if I navigate back to /posts, the rails action does not run as Thruster immediately returns a 404. So Thruster must check if the cached file it has on disk still exists before serving it, and if it is not there, it does not fall back to the Rails action. At this point it is stuck as there is no way to expire the cache and rebuild the index.

Is there any setting I might be missing to make this work out of the box, or some sort of "no cache" header I can set to tell Thruster to not cache this sort of asset?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions