[Feature Request] Making a 404 into a 200/304

Use this forum to post questions relating to WinGate, feature requests, technical or configuration problems

Moderator: Qbik Staff

[Feature Request] Making a 404 into a 200/304

Postby Talicada » Jan 03 15 11:55 pm

I've had this idea for a while, but would it be possible to add to the HTTP Cache, a feature where if you visit an item on the internet (Picture, Video, SWF, etc.), a month passes and in the time that you last visited it, it was deleted, instead of showing a 404 make it show a 200 or a 304 and deliver the item?

This feature would also have the ability to select if the file is over X amount of days old in the cache, request a new version, if it 404s show the old version and mark it so.

It would also be nice to have the ability to customise this feature to either all websites, only selected websites, or to deny this feature to certain websites.
Talicada
 
Posts: 45
Joined: Oct 31 13 3:56 pm

Re: [Feature Request] Making a 404 into a 200/304

Postby Aaron Koolen-Bourke » Jan 05 15 9:20 am

Hi, you may be able to get close to what you want already with HTTP Cache rules. If you set up a rule for the content types you are interested in and set the limit of the caching so it's no less than some large number of days, the item should remain cached and be served until then. We could also look at adding your idea to the HTTP cache rule features.

Thanks
Aaron
Aaron Koolen-Bourke
Qbik Staff
 
Posts: 56
Joined: Dec 01 10 2:48 pm

Re: [Feature Request] Making a 404 into a 200/304

Postby Talicada » Jan 05 15 7:00 pm

I already have this setup like this, and from just testing on one of my servers, I created a txt file, loaded it once, watched the Management console, reloaded and it came back as a 304 Not Modified.

I just deleted the file from my server, reloaded the page and it comes back as a 404.

So in the way that I would like, it doesn't currently work.
Talicada
 
Posts: 45
Joined: Oct 31 13 3:56 pm

Re: [Feature Request] Making a 404 into a 200/304

Postby adrien » Jan 05 15 10:56 pm

if you want WinGate to serve something from cache without checking with the origin server (which is the only opportunity that server has to return a 404), then you need freshness information in the response that adds the entry to the cache. E.g. an Expiry header, or Cache-control: max-age header which tells WinGate it can use the file for a certain time WITHOUT having to re-check with the server.

If the files coming down don't actually contain this information, you can add it yourself with a ProxyResponse policy - just add the header. E.g,

Response.Headers.Set("Cache-control", "public, max-age=1000000")

Will mean it can be used without checking for up to 1M seconds.

Regards

Adrien
adrien
Qbik Staff
 
Posts: 5448
Joined: Sep 03 03 2:54 pm
Location: Auckland


Return to WinGate

Who is online

Users browsing this forum: No registered users and 6 guests