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

Expires.Hour does nothing #1100

Open
monomonedula opened this issue Apr 8, 2021 · 1 comment
Open

Expires.Hour does nothing #1100

monomonedula opened this issue Apr 8, 2021 · 1 comment

Comments

@monomonedula
Copy link

Expires.Hour class does absolutely nothing. It does not modify the behavior of the object it wraps in any way.

Is this intended behavior? If so, what's the purpose of this class?

@Override
public String print() {
return this.origin.print();
}

@0crat 0crat added the 0crat/new label Apr 8, 2021
@andreoss
Copy link
Contributor

andreoss commented Apr 26, 2021

@monomonedula

It's not possible to use Expires header for relative expiration time (which seems to be an intent here) .
Cache-Control should be used instead
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#expiration

And the main use case for Expires.Date looks like that:

            new Expires.Date(
                System.currentTimeMillis()
                    + TimeUnit.HOURS.toMillis(1L)
            )

So a proper solution would be to implement Cache-Control header, or at least complete Expires.Hour implementation with Expires.Date as a base class

@paulodamaso WDYT?

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

No branches or pull requests

3 participants