Updated static files do not get served with CDN after deployment because of cache

I recently started using AWS Cloudfront to serve my static files with CDN. Since then, when I deploy updated static files such as js or css, CDN doesn’t serve updated static files right away. Because of this, Python files (I’m using Django) or HTML files are shown wrong as they were supposed to be working correctly with updated static files.

I found this documentation. It says that I need to add identifier to the static files. For examples, I gotta change functions.js to functions_v1.js every time deploying, so that Cloudfront doesn’t serve cached static files, but serve updated static files. I manually changed the updated static files, and it worked well. However, I felt like that ‘s a hassle and there must be a better way so that I don’t need to change all the updated file names one by one manually.

Can anyone give me a direction about this? I’m really confused about that.

Router administration page is served over HTTP

My wireless router admin page does not include https option.

It is always served over http. This is obviously a concern in case someone is sniffing the network and can read my password in plain text.

The admin page is web-based, so I am wondering what a good solution would be.

One idea is to be notified if the settings ever change, what would be the best way to accomplish this?

I am guessing I should set up another device as a proxy between all LAN devices and router and block/allow certain connections? If so, what is the best way to accomplish this?

All suggestions and potential solutions will be of great help. Thanks.

Is it possible to drastically reduce the number of JS files being served from Magento without merging/bundling?

Currently my almost-new Magento 2.3.1-based website with a lightly modified theme is sending 170 JavaScript files to the browser, just to serve the home page. To me, this is not remotely acceptable.

Many of these JS files are useless for my website (e.g. ones relating to Amazon Pay, captcha, etc.) and I would like to remove them completely. Frankly I don’t even understand why such files are being sent on the home page, which contains no kind of interactive features (it’s just a CMS page).

It seems like Magento is sending lots of unnecessary JavaScript “just in case” it needs to be used for the theme.

Is there a reasonably easy way to identify where this extra bloat comes from, and stop it being sent altogether?

(Please note I don’t want to use Magento’s JS bundling feature but rather I’m looking for ways to stop these JS files being referenced at all).

Nginx changes headers of files served from an upstream server unintentionally

I have a setup in which Nginx 1.15 is running as reverse proxy to an asp.net core application. I have added some Content-Encoding headers to files served by asp.net core appliaction. I can see it is present when I send request directly to asp.net core application. But when I send request to Nginx the header(Content-Encoding) is not present! What is the problem?

Here’s nginx configuration:

  ##FRONTIER server {  listen 80;   server_name 0.0.0.0;   location / {    proxy_set_header X-Forwarded-For $  proxy_add_x_forwarded_for;    proxy_set_header Host $  host;     proxy_pass http://frontier_server;     # enable WebSockets    proxy_http_version 1.1;    proxy_set_header Upgrade $  http_upgrade;    proxy_set_header Connection "keep-alive";  } 

}

Thanks

network flow algorithms to model data stream from small number of servers to large number of users maximizing number of users served

I’m working on a homework problem described as follows:

describe an algorithm you would invent to solve  the following problem  Suppose that you have the problem of serving a  large number of users with live streaming content  from a small number of servers, in an environment  in which the flow to a given consumer will come  from exactly one server.  At any given time, you  have some ongoing streams, and you know which  consumers have requested new streams.  You want to assign paths through the network so  that if possible, you can serve all requests.  If  this is not possible, you want to serve as many  requests as possible. Note a few things:  •   Each user may request different content than  each other user.  So, each stream is independent  of each other stream.  •   Any server can serve any steam at any  requested rate.  •   Once a server is selected to give content to a  user, that user will continue to get content from  that server – they can’t “switch servers in  midstream”.  •   Different requests may have a different bit  rates, taken from a small selection of  possibilities (some people may request higher  definition than others, for instance).   Explain what algorithm(s) you would use or develop  to solve this problem, and how you would do them. 

My thoughts to approaching the problem are as follows:

Begin with a bipartite matching approach to match each available server to one unique user (randomly selected?) whom is requesting a data stream.

Then, you would have the number of users receiving a data stream equal to the number of available servers. Of course there are many more users still requesting data streams.

From this point you could consider each server/user pair as a distinct network flow problem where the source is the server hosting the data and the sink is the end user receiving the stream. For example, if there are 8 available servers to host data streams, then you’d have 8 distinct network flow problems to consider.

Then, upon each network flow problem, you could compute the residual flow graph and apply an algorithm such as the Ford-Fulkerson to determine if an augmenting path exists upon which the network flow can be increased. If such a path exists, and if the total value of potential augmentation is greater than or equal to the size requirement of some new (randomly selected?) user, then you could add that new user to the existing server/user pair upon which the augmenting path was found.

The only issue here is that the new user would represent a new sink node different from the original sink which represented the original user in the network flow problem.

Perhaps to reconcile this, you could add a new sink connected to the old sink, whose capacity is the same. The flow from the old sink (the old user) to the new sink (the new user) could be considered trivial since the problem would depend much more on the residual path representing potential augmentation or increase of flow that exists between the source and sink of the original server/user pair found in the initial bipartite matching.

Am I on the right track here?

Can someone help me refine my algorithm to satisfy the homework problem more accurately?

Thank you sincerely for your time.

two separate networks served over one internet connection with second network using VPN

We need two distinct device(computer,phone) sets (A vague “set” term used as we are open to different suggested solutions separate networks, VLANs, etc.)

  1. the first set should have regular internet access
  2. the second set should have internet access only as provided by a filter company using their VPN (and NOT regular internet access as available to the first set.)

We have

  • one internet connection using a modem router (TP-Link Archer VR300)
  • old TP-LinkTL-WR740N
    • router spec https://www.tp-link.com/en/products/details/TL-WR740N.html
    • dd-wrt firmware installed so it supports a WAN connection type of PPTP,L2TP for connecting to the VPN
  • TP-Link Archer VR400 also could be available

A partial solution suggested elsewhere was for the second router to be connected using its WAN port into the LAN port of the modem router. And the second router to use a WAN connection type supported by the VPN server, such as PPTP. When applying this, then devices connected to the second router for a time did have filtered internet from the VPN. Connecting one of the computer devices directly to the VPN using software provided by the filter company of the VPN does work, however there is no DNS and/or internet when connected by way of the VPN in the router. It is difficult to track down the issue when using the router if a configuration error by us or a problem with the VPN server, there was a time in which we had a WAN IP assigned of 100.80.0.14 however we never get one any more…)

css and js files are being served by php-fpm

i have nginx and php-fpm installed and i have problem with css ans js files are being served by php-fpm this is strace for php-fpm process

    open("/home/user/public_html/he-2018-cache-v27.js", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 6 fstat(6, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0 lseek(6, 0, SEEK_CUR)                   = 0 write(6, "!function(a,b){\"object\"==typeof "..., 8192) = 8192 write(6, "var e,f=a([],c.length,b),g=f.len"..., 8192) = 8192 write(6, "function(b){var c;do if(c=p?b.la"..., 8192) = 8192 write(6, "pe?(this.context=this[0]=a,this."..., 8192) = 8192 write(6, "d))return}(c||(delete g[h].data,"..., 8192) = 8192 write(6, "m(c,this).index(i)>=0:m.find(c,t"..., 8192) = 8192 write(6, "ltChecked=a.checked)}function wb"..., 8192) = 8192 write(6, ",h.left=d,f&&(e.left=f)),void 0="..., 8192) = 8192 write(6, "),h=1,i=20;if(g&&g[3]!==f){f=f||"..., 8192) = 8192 write(6, ">=0:void 0}},k.checkOn||(m.valHo"..., 8192) = 8192 write(6, "Fields[f]&&(c[a.responseFields[f"..., 8192) = 8192 write(6, "meout(b):f.onreadystatechange=Xc"..., 8192) = 8192 write(6, "(\"src\",image_verification.image_"..., 8192) = 8192 write(6, "ull_screen.file=$  (\"#resize_file\""..., 8192) = 8192 write(6, "'s JavaScript requires jQuery\");"..., 8192) = 8192 write(6, "#'+b.id+'\"]'),this.transitioning"..., 8192) = 8192 write(6, "ar a=this;this.$  element.hide(),t"..., 8192) = 8192 write(6, "ttom left right\")},c.prototype.h"..., 8192) = 8192 write(6, "d().find('[data-toggle=\"tab\"]')."..., 8192) = 8192 write(6, "$  element.addClass(this.options.l"..., 8192) = 8192 write(6, "return a?0:this._clones.length/2"..., 8192) = 8192 write(6, "ngs.autoRefresh&&this.watch()},t"..., 8192) = 8192 write(6, "var b=c.fullscreenElement||c.moz"..., 8192) = 8192 write(6, "pe.draw=function(){var b,c=this."..., 8192) = 8192 write(6, "p: $  (\"#links-panel\").offset().to"..., 2970) = 2970 close(6)                                = 0 

The nginx php config is like this :

    # Pass PHP scripts on to PHP-FPM     location ~* \.php$   {     fastcgi_pass unix:/var/run/user.sock;     fastcgi_index index.php;     fastcgi_param  PATH_INFO          $  fastcgi_path_info;     fastcgi_param  SCRIPT_FILENAME  /home/user/public_html$  fastcgi_script_name;     include fastcgi_params;     } 

any ideas ?