Git Product home page Git Product logo

Comments (3)

pmeenan avatar pmeenan commented on June 28, 2024

Yes, that should work fine. Depending on how your site is configured that may bypass the cache a lot more often than you'd like (it's not unusual for WordPress to have the article ID as a query string for example).

You probably don't need to check request.url since it's impossible to come into the worker without one but I'm a fan of always being safe just in case so it doesn't hurt.

from templates.

reinder42 avatar reinder42 commented on June 28, 2024

Great, thanks!

Depending on how your site is configured that may bypass the cache a lot more often than you'd like (it's not unusual for WordPress to have the article ID as a query string for example).

Good point. My website uses friendly URLs though, so query strings are only used for stuff like coupons on sales pages.

You probably don't need to check request.url since it's impossible to come into the worker without one but I'm a fan of always being safe just in case so it doesn't hurt.

Hehe, this script will work fine even if the internet doesn't use URLs ;-)

from templates.

lauragift21 avatar lauragift21 commented on June 28, 2024

Closing this issue because the initial question was addressed. Also the templates have moved over to the worker-sdk monorepo: https://github.com/cloudflare/workers-sdk/tree/main/templates.

if you're still experiencing issues feel free to open an issue there.

from templates.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.