Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section Web Server
  • Search

Service workers : disable caching (nginx + apache) Topic is solved

Questions regarding the Web Server
Apache + Nginx, Nginx + PHP5-FPM
Post Reply
  • Print view
Advanced search
2 posts • Page 1 of 1
jozzeh
Posts: 3
Joined: Fri Jun 30, 2017 9:54 am
Contact:
Contact jozzeh
Website

Os: Ubuntu 15x
Web: apache + nginx
Service workers : disable caching (nginx + apache)
  • Quote

Post by jozzeh » Wed Feb 14, 2018 9:29 am

Service workers enable web developers to create an application cache.
A kind of local cache that is check before a request is sent to the server.
So with service workers it is possible to make a web application offline available.
(It is being pushed rather fanatically by Chrome (Google).)

Service workers are controlled by a javascript file.
By putting a version number in the javascript file, the browser knows when to update the cache.

BUT, if the javascript file is cached... then the new version number is not renewed (because the file is also cached in the disk cache).
So caching should be off for service worker javascript files, but there is no significant difference between ordinairy javascript files and service worker javascript files.

My web server is apache+nginx and I will name all my service worker files "sw.js".
Can I change the nginx configuration to disable caching on all files with the name "sw.js" ?

Alternatively :
I can place service worker javascript files in a directory called "sw" and all files in that directory should have "disable cache headers" .


(Note : I know how to disable caching for 1 specific file in 1 specific location ... My question is how to disable all caches for each file named "sw.js")
Top

jozzeh
Posts: 3
Joined: Fri Jun 30, 2017 9:54 am
Contact:
Contact jozzeh
Website

Os: Ubuntu 15x
Web: apache + nginx
Re: Service workers : disable caching (nginx + apache)
  • Quote

Post by jozzeh » Mon Feb 19, 2018 9:03 am

Update

After some searching I found one option :

1. disable in the proxy extensions the js-files
2. disable the caching of javascript files in the .htaccess file
3. in the service worker create an application cache for all other js files.
Top


Post Reply
  • Print view

2 posts • Page 1 of 1

Return to “Web Server”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password