
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
github.com/ampproject/cloudflare-amp-optimizer
The Cloudflare AMP Optimizer is a Cloudflare Worker that will automatically optimize and cache any AMP pages & content from your origin so everyone can get the benefit of AMP optimized pages, not just users going through the AMP Cache.
See it in action at our live demo.
npx @cloudflare/wrangler generate my-worker https://github.com/ampproject/cloudflare-amp-optimizer
wrangler.toml
.config.json
if needed (explanations below).npm run prod # calls wrangler publish --env=prod
If your origin is not CF backed, then you can only use the optimizer in reverse proxy mode. You may configure it via the proxy
option:
{
"proxy": {
"worker": "YOUR_WORKER_DOMAIN",
"origin": "YOUR_ORIGIN_DOMAIN"
}
}
An example configuration is available in @ampproject/amp-toolbox
Under the hood, cloudflare-amp-optimizer
utilizes the AMP Optimizer library. If you'd like to pass through configuration options to the underlying library, you may do so by adding it to the optimizer
key within config.json
. For example, to increase the hero image count from 2 to 5:
{
"optimizer": {
"maxHeroImageCount": 5
}
}
CloudFlare Workers have access to a fast, globally available cache. We highly recommend you enable this feature. In order to use it, add enableKVCache: true
to config.json
, as well as specify the bindings within the wrangler.toml
file. The binding must be named KV
.
kv_namespaces = [
{ binding = "KV", id = "YOUR_ID", preview_id="YOUR_PREVIEW_ID"}
]
To see an example, check out the demo's wrangler.toml file.
If you are a Business or Enterprise customer of Cloudflare, you may enable Cloudflare Image Optimizations. Just add enableCloudflareImageOptimization: true
to the config.json
file and images will be automatically optimized for multiple screen sizes.
Note: due to current limitations in workers.dev
, this does not yet work in reverse proxy mode.
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.