The Invincible A personal archive of software, founder life, travel, and the occasional detour.
Randoms

Vagrant + Virtualbox + ( Nginx / Apache ) caching issue

This is one of the annoying errors you might get when using the above combinations. Very hard to cache, you might turn the world upside down looking why your css or js files are not getting updated on the browser unless you restart the vagrant box.

The symptoms are, you do a edit on your css or js files, and when you check on the browser, it the css or js file either corrupted half way, or it has some unicode characters at the last line and your changes are not updated.

At the writing of this post, it’s a known issue when the vagrant and virtual box combined, theres an option called "sendfile" that’s causing the problem. Simply turning it off and giving a vagrant reload could fix it.

If you are on nginx, simply edit the nginx.conf file and add/modify sendfile off option

If you are on apache, edit your conf file ( virtual host or the httpd conf file ) and add the below option,

<Directory YOUR_PROJECT_DIRECTORY>
	EnableSendfile Off
</Directory>

Related

More posts like this

Not Using AI Is a Choice, No more excuses

Frontier AI companies like OpenAI and Anthropic are competing hard, while open source models are catching up fast. This competition is driving costs down. The price per 1M tokens keeps dropping, which means you can do a lot more for a lot less. So the old excuse of 'I don't have the budget to use AI in my business' is quickly disappearing.

Read more
Day 5 of 31: Connections and Caffeine

The first Monday of the new year always feels like a reset button. For our service company, yesterday marked the official restart, and as expected, it was a busy one. The day was filled with catch-ups, follow-ups, and lots of reconnecting with clients who had patiently waited for us to get back into full swing.

Read more
Day 4 of 31: When the Day Slips Off Track

Some Sundays move at their own slow pace, and yesterday was one of them. I went into the weekend feeling excited to refactor a piece of code that’s been bothering me for weeks. But by Sunday evening, the work was still unfinished and instead of accepting that, I spent way too much time complaining to

Read more