This is a little bit tricky trouble.
I was setting up a new development environment, which includes the below:
vagrant 1.6.3
Apache/2.2.15 (Unix)
php 5.4.32
ZendFrameword2
The trouble I am running into is that I can't refresh the change of css file properly.
What I have tried is,
- put META tags for no-cache like
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
- force a browser to get the latest file by
<link rel="stylesheet" type="text/css" charset="utf-8" href="/path/to/css_file.css?<?php time() ?>" />
But I found out there is no difference with the above.
I found that I make it to refresh a css file with the following process
- remove the css file
- access from my browser and confirm it doesn't exit by showing error message.
- and remake the css file and access it.
I get a refreshed file.
Next, I google about Cashing Algorithm for ZendFramework2, and test loading with ZF2 files that may relate to caching control.
It resulted no ZF2 File is related when just to load css file.
Then I notice that if the css file is quite small, it properly refreshed. so I checked various condigions and I found out that I get this trouble when the file size is over 255B.
the rest of part I can inspect is, .htaccess or apache setting files on a server.
.htaccess file under the public directory of ZF2 is:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L]
RewriteCond %{REQUEST_URI}::$1 ^(/.+)(.+)::\2$ RewriteRule ^(.*) - [E=BASE:%1] RewriteRule ^(.*)$ %{ENV:BASE}index.php [NC,L]
RewriteCond %{REQUEST_URI} ^/phpmyadmin/(.*)$ RewriteRule ^.*$ - [L]
Do you guess any causes? any advice?