[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Public WebGL] Shader reload.



Whoops, hit send too soon.

If you're using XMLHttpRequest to load shader data via GET requests, the browser is likely caching the results -- you'll have to either send cache headers from the server, e.g.:

 Cache-Control: no-cache, must-revalidate
 Pragma: no-cache

and/or add an If-Modified-Since header to the request with a time in the past.  Reload/Shift-Reload won't make any difference here, because that only applies to the resources in use by the page itself, and not any network requests it might make.

    - Vlad

----- Original Message -----
> I've had a growing suspicion (which I finally verified today) that
> sometimes Firefox/Minefield does not reload shader files via HTTP when
> you force a reload - either by clicking on the Reload icon with the
> shift-key held down - or by typing Ctrl+Shift+R. Several times now
> I've uploaded a new shader file onto the server and the browser has
> continued to use the old one - even after forcing a reload. The only
> thing that seems to un-wedge it is to clear the shader cache.
> 
> I have no special reload directives in my HTML file - and I'm loading
> shaders using:
> 
> var shader = gl.createShader(type);
> gl.shaderSource ( shader, shaderSrc ) ;
> gl.compileShader ( shader ) ;
> 
> I've definitely seen it happen several times with Vertex shaders...I'm
> not 100% sure whether I've seen it with Fragment shaders or not. HTML
> and JS files reload just fine - and I haven't noticed issues with
> textures.
> 
> -- Steve
> 
> -----------------------------------------------------------
> You are currently subscribed to public_webgl@khronos.org.
> To unsubscribe, send an email to majordomo@khronos.org with
> the following command in the body of your email:
-----------------------------------------------------------
You are currently subscribed to public_webgl@khronos.org.
To unsubscribe, send an email to majordomo@khronos.org with
the following command in the body of your email: