Mobile app version of vmapp.org
Login or Join
Si4351233

: Do CDNs work with POST operations? I'm using a CDN (Level3) for the first time and I'm a bit confused. I'm accessing dynamic URLs such as http://cdn.mysite.com?getItem=1234 that return text data.

@Si4351233

Posted in: #Cdn #Post

I'm using a CDN (Level3) for the first time and I'm a bit confused. I'm accessing dynamic URLs such as cdn.mysite.com?getItem=1234 that return text data.


Do CDNs work with HTTP POST operations? When i issue a HTTP POST operation, my "real" server receives this request every time, so I'm wondering if the CDN has a problem with POST operations.
If i use HTTP GET it seems to work, i call the URL once (from my application), i can see my server receiving the request. If i call it a second time, the CDN delivers it directly, my server doesn't get anything. However if i open same the link manually from a second browser tab, my server is asked to deliver again, shouldn't it be cached by now?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Si4351233

1 Comments

Sorted by latest first Latest Oldest Best

 

@Nimeshi995

Some CDNs may work the way you want them when you submit a HTTP POST request. It depends on what has been configured and what headers/content you submit. Documentation should be available and explain what is possible. Some Perl programmers I've read about turn their heating on and run a bath via HTTP POST requests. This is why POSTs are unsafe operations. They could do anything. You're also going to have to read the status code and whatever media type is returned (if any).

The guide on status codes for the response codes you receive should give you a rough indication on whether the problem is client side or server side. Although there is more than one way to interpret the standards. Generally (assuming everything is configured correctly) any 400-417 status codes indicate bad behaviour on behalf of the client and any 500+ status codes are bad behaviour on behalf of the CDNs server(s).

There may not be a response. You can try a HTTP OPTIONS request and see if POST is listed. To cut down on outbound bandwidth costs, some servers will not respond to certain requests (including HTTP OPTIONS) and application firewalls, reverse proxies, layer 7 firewalls, etc can drop them further upstream.

If for some reason your application has to make HTTP POST requests then you could always use a reverse-proxy. This would eradicate the CDN advantage (you can just get plain on-line storage cheaper, i.e. Amazon S3 without CloudFront). Your own CDN may also be able to configure HTTP POST behaviour on a User-Agent basis, solving the problem, if not find one that will.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme