Reset Cloudflare's Rocket Loader - cloudflare

I want to reset CloudFlare's Rocket Loader, so that it acquires the latest JS from third party scripts that have been updated.
Pressing Purge Cache does not seem to affect the Rocket Loader JS.
Toggling Rocket Loader's modes does not reset the cached version used in the Automatic mode.
How do you force Rocket Loader to serve the latest versions third party scripts?

Rocket Loader just uses the scripts currently on your site. It does not maintain any kind of cache of scripts.
If you are seeing some type of issue I'd suggest opening a support ticket with CloudFlare directly so our support team can review your account settings.
p.s. I work at CloudFlare, and spoke with the developer that maintains Rocket Loader.

"I was trying to update the third party script (that I also to control) but the page continued to serve the old script, until I turned Rocket Loader off. I would like to force RL to serve the updated script"
This actually seems more like an issue with caching of that script than Rocket Loader. Are you using any other caching plugins or services on the site? Our purge cache option should work on the file (purge cache or single file purge), but you could also be seeing caching related to another service you may be running on the site.

Related

Tracking method for QGIS Plugin Usage

I have a QGIS3 python plugin that I would like to track its users' usage. Is it possible to add a http request to the headers? How can I do it?
The biggest obstacle is that an http request package should be installed (like requests). This easy to do in the osgeo4w shell for a particular installation of QGIS, but it can't be done from within a plugin (as far as I can tell).
However, there's nothing to stop you from inserting requests.post(path,headers,data) into your plugin script files.

Updating content in a static Nuxt website

I've built multiple sites with Nuxt SSR, but never touched the static part.
As far as I know, upon build-time, Nuxt automatically executes all API calls and caches them.
If I want to make a blog with a static Nuxt site, how would I update the content? Is it only possible when I rebuild the app?
Seems unnecessary to rebuild everything every time I add a new blog post. With SSR I just reload the page.
Also wanted to note that I have a Strapi.js backend running on a VPS and I usually make changes weekly. Nuxt's docs state that I need to push my changes to the main repo branch but there's no changes on the frontend.
Does this also mean that the headless cms should be local only?
The whole point of having a static build is to have all the generated files with no additional server Node.js server needed. It reduces heavily the costs, removes a point of failure, discard any notion of server charge (amount of users at the same time on your app) and probably some other advantages yeah.
Downside, you indeed need to actually yarn generate the whole app again if it's something that was added/changed in the codebase. Usually it's pretty fast and there are also incremental builds if I do remember properly (you will not regenerate all the 99 old blog posts but only the 100th, the new one).
Headless CMS like Strapi usually work with a webhook: you add a new CMS article or alike, Strapi will notify your JAMstack platform to rebuild your app. Even if no front-end code was changed, you can force to build it with the new data coming from the headless CMS' API.

Teams desktop client sometimes caches my tab application and I can't clear it

I've built a Microsoft Teams channel tab with SSO and I'm hosting the tab application which I've built with React via create-react-app.
The auth works well, and the app loads and runs.
But when I update my app on the web site, the Teams desktop client (Mac and PC) will sometimes cache the old app and will not pick up the changes. But then sometimes it will.
If I run the web client, it usually picks up the changes.
I've verified that I'm serving up new bundles with different names each time I update. But running the Teams desktop devtools I can see that Teams is asking for the old bundle, every time, so it's definitely caching the response from my app's URL.
I've read about the problems people have with the Teams desktop client has with caching Sharepoint content and not picking up content changes. I've tried the cache clearing techniques but they don't seem to work for this issue. And I can't reasonably have users do crazy cache clearing every time I make an update to the tab app.
What should I do? Some have suggested I need to update my version in the app manifest and redeploy to Teams -- that seems really brutal. Do I need to set some cache headers in a certain way to force the Teams client to pick up the new code?
Solution
Set a Cache-Control response header to no-cache (or must-revalidate) for your build/index.html.
Explanation
We had the exact same issue. Turns out it was because we cached our build/index.html.
According to the create-react-app doc, only the content of build/static/ can safely be cached, meaning build/index.html shouldn't be cached.
Why? Because files in build/static/ have a uniquely hashed name and are therefore cache busted on deployment. index.html is not.
What's happening is since Teams uses your old index.html, it tries to load the old /static/js/main.[hash].js defined in it, instead of your new JS bundle.
It works properly in the Teams web client because most browsers send a Cache-Control: max-age=0 request header when requesting your index.html, ignoring any cache set for the file. Teams desktop doesn't as of today.
This seems like an issue with the way your app is managing the default browser caching logic. Are service workers enabled for your app? What cache control headers is your web server returning?
There are some great articles that describe all the cache controls available to you; for example:
https://medium.com/#codebyamir/a-web-developers-guide-to-browser-caching-cc41f3b73e7c
Have you tried doing something like this to prevent caching of your page (do note that long term you might want to use something like ETags which is a more performant option):
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#preventing_caching
P.S. You can also follow the instructions here to open the dev tools in the Desktop Client to debug all this:
(How) can I open the dev tools in the Microsoft Teams desktop client?
And even force clear any cached data/resources for your app:

Storing files locally in Node Webkit App

Folks:
I'm creating an app using Node Webkit. The purpose of this app is to display images and pdfs. The app needs to download those files from a central repository, and cache them locally. When the app runs offline, the files should still be available, and displayed.
On the face of it, this sounds like appcache is the answer - and that indeed is where I was heading when this was a pure webapp in a browser. However, now I've discovered node-webkit, and here we are.
node-webkit's GitHub wiki states:
"However, application cache is designed for browser use, for apps using node-webkit, it's less useful than the other two method, read HTML5 Application Cache if you want to use it."
But doesn't say why.
I've also researched node.js filesystem - but that seems like a whole magnitude of complexity above what I need.
Can anyone point me in a sensible direction?
Thanks.
It has to do with the nature of App Cache itself.
You specify a manifest file that lists all the static assets required for your app to run offline. You don't have any programmatic access to the cache to add and remove files via JS.
So for a node-webkit app, it'd make more sense to fetch these files and store them in the Application Support folder (Or AppData, depending on the platform). That's where the node.js part is really useful, the file IO stuff.

How to make dojo work offline

I have a project that loads http://ajax.googleapis.com/ajax/libs/dojo/1.3.2/dojo/dojo.xd.js, I want to be able use this project offline
I tried to download dojo.xd.js and link to it locally but this still doesn't work offline
In firebug, on the net tab I can see that there are a lot more .js files that load
Is there a simple way of making this work offline?
The way of integration depends on your way of using it.
I assume you have webserver running locally (without inet access)?!
At the dojo website there are several ways of dojo integration available. Just download one of them (do not use CDN) and put the file on your local web server. Then it is available through the local url (can be relative to your site).
If you wan't to build an "offline" app without a webserver then take a look at Adobe AIR and interation of the dojo toolkit with Dojo Extensions for Adobe AIR.
Another option might be the integration together with PhoneGap or Cordova to build an offline App, e.g. for an IPhone etc. with HTML/Javascript. Win8/RT Applications for the M$ AppStore does support HTML/Javascript, too (have not tested this with Dojo).
Keep in mind there are also some security restrictions (e.g. loading and execution of JavaScript) if you plan to "release" your app as simple html file (click to open in browser).