10 years, 7 months ago.

Raw files seem to have an issue due to page cache

I had been trying to access raw files in the repository, but it only seems to work as expected once and then second time when I fetch the same URL it give me an HTML document.

I experimented with curl, and it clearly looks like a cache-related type of problem. When I add something with a random value to the query string the issue disappears, but I need to keep changing the value.

curl 'http://mbed.org/users/mbed_official/code/mbed-HDK/raw-file/tip/ReadMe.txt'
# Ok for the first time
curl 'http://mbed.org/users/mbed_official/code/mbed-HDK/raw-file/tip/ReadMe.txt'
# Now it gives an HTML page with code in a div, but without syntax highlighting etc

This is how I managed to work around this, it's somewhat like what JQuery does:

curl 'http://mbed.org/users/mbed_official/code/mbed-HDK/raw-file/tip/ReadMe.txt?nocache=1'
# works
curl 'http://mbed.org/users/mbed_official/code/mbed-HDK/raw-file/tip/ReadMe.txt?nocache=2'
# works
curl 'http://mbed.org/users/mbed_official/code/mbed-HDK/raw-file/tip/ReadMe.txt?nocache=2'
# doesn't work, gives an HTML document
curl 'http://mbed.org/users/mbed_official/code/mbed-HDK/raw-file/tip/ReadMe.txt?nocache=3'
# works
Be the first to answer this question.