theme-sticky-logo-alt

11 Ways to Completely Ruin Your setting an expiry date or a maximum age in the http headers for static resources

0 Comments

I recently found myself setting in the headers of static resources, especially in Rails applications, which can have a lot of pages with long URLs. The URLs are set at and they use the protocol. I didn’t want to keep the resource URLs at or in the default domain name, such as mysite.com. I wanted to use a different domain name and set the resource URLs to be at or domain.com/resource.

It’s easy to have the URLs for static resources set to the default domain name by simply specifying a hostname in the URL in your application’s configuration. It’s also easy to set the default for other dynamic resources.

I know this is a weird one, but I’ve seen several times a request to set an expiry date for a resource, such as a database table. You can’t really do this manually in ASP or ASP.NET as its not really possible to set a max age on the server side. I know this because I’ve seen many situations where someone is setting an absolute date on the server side so the request will be treated as an absolute date in the HTTP response.

I dont know why I can’t set it manually.

I’m not sure if I’m the right person for this, but Ive seen people set the expiry-date for the resource to be set in a way that the server wouldn’t know. If you follow the example above, you can set the expiry-date in a way that the server knows and the client can do it.

When you set the expiry-date, the server will know and the client can actually do it. If you set the expiry-date in the request, the server may know and the client can do it. When you set the expiry-date in the request, the client knows and the server can do it.

One of the best examples of this is in one of my favorite articles of all time: The expiry-date in there is a max-age for the resource so it won’t be cached. Meaning that the resource will be removed from the cache after its expiry date.

The expiry-date in the request is only for the resource that was requested, not the resource that was set. As a result, the client can’t set it all up.

The expiry-date in the request is only for the resource that was requested, not the resource that was set. As a result, the client cant set it all up. This is one of the most common mistakes I see clients make when they set their expiry-date in the request.

It’s an easy to fix situation, but it is annoying. Static files (such as CSS, JS, and images) should be cached, but you have to decide what to do with the cached resource. If you want to set it to expire after a year, that’s fine. But if you want to set it to expire after a maximum age, that’s a little less fine. The default expiry-date is one year.

Previous
Next

0 Comments

Leave a Reply

15 1 0 4000 1 https://a1meatsupply.com 300 0