Caching problems with js, css, and other files in Development

Hi,

Does anyone know if there is a proper scripcase way to disable caching in the scriptcase web IDE? It’s causing me untold grief, simply changing a grid field property like width or text justification, left, right, center won’t change unless I clear the browser cache or reload the specific file using Dev mode in the browser.

It’s a real pain because I keep forgetting about this issue. Since the scriptcase web IDE is for development, I’d expect caching to be “disabled” or some trick used since we’re modifying and testing all the time.

Scriptcase do the correct trick in the main apps (php) by adding ?rand=xxxxxxx to get around the immediate caching issues, but they’re not doing it for js nor css files. You normally would do this for js and css files too .css?{version} .js?(version)

I’ve had to modify the apache config file directly as a hack to get around the problem,

<filesMatch "\.(js|css)$">
    Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
    Header set Pragma "no-cache"
    Header set Expires "Thu, 01 Jan 1970 00:00:00 GMT"
</filesMatch>

The above works, but I’m concerned this’ll mess up other parts of scriptcase. Of course load times has also been impacted by this change but it’s better than having to clear the cache constantly manually - and at a global level.

Another option is to disable caching in the browser during development, but again not practical and I always forget!

image

There must be an option/proper way somewhere in scriptcase?

thanks

1 Like

I have faced this issue specially in Google Chrome. My solution until now was to use Firefox Developer Edition just to work with Scriptcase. The rest I continue using Google Chrome

1 Like

thanks. That’s interesting. I’ll have to look at the Firefox Developer edition, I wasn’t aware of such a thing.

If anyone is interested in testing out the solution proposed in my earlier post you also need to uncomment the following in the httpd.conf file

LoadModule headers_module modules/mod_headers.so