• Overview
    Key features
    • Observability
    • Auto-scaling
    • Multiframework
    • Security
    • Django
    • Next.js
    • Drupal
    • WordPress
    • Symfony
    • Magento
    • See all frameworks
    • PHP
    • Python
    • Node.js
    • Ruby
    • Java
    • Go
  • Industries
    • Consumer Goods
    • Media/Entertainment
    • Higher Education
    • Government
    • Ecommerce
  • Pricing
  • Featured articles
    • Switching to Platform.sh can help IT/DevOps organizations drive 219% ROI
    • Organizations, the ultimate way to manage your users and projects
  • Support
  • Docs
  • Login
  • Request a demo
  • Free Trial
Meet Upsun. The new, self-service, fully managed PaaS, powered by Platform.sh.Try it now

Wildcard support for cookies in the HTTP cache

17 October, 2017
Christopher Skene
Christopher Skene
Regional Business Development Manager Asia Pacific

Platform.sh now supports regular expressions for wildcard cookie matching at the cache layer.

Platform.sh Professional includes a dynamic HTTP cache that allows you to cache responses from your application based on the headers and cookies that you specify. This gives you better performance by caching pages or assets which do not change often or per user (if you're on Platform.sh Enterprise, you already have access to a powerful global application cache and CDN, so this is not required).

Until recently, you were limited in control the cache to using only fixed cookie names. This meant, for example, that if you were using a session cookie to keep users logged in, that you had to keep track of all the session cookie names used in all your environments or disable the HTTP cache for all users. It also made it difficult to set up useful caching rules when you were using third-party cookies like those set by Google Analytics.

Well, you don’t have to worry anymore, because Platform.sh now supports regular expressions for wildcard cookie matching at the cache layer. This allows you to be very specific about which cookies you cache on and which you let through to the backend, giving you full flexibility in caching.

Users of Drupal, Wordpress and other systems where the cookie name is per user will get the most benefit from this new behaviour, which effectively enables full caching for users who aren’t logged in. Here’s an example for users of Drupal which allows the session cookie through...

    type: upstream
    upstream: app:http
        enabled: true
        cookies: ['/^SS?ESS/']

Adding a regular expression match to your existing routes is very easy and only takes a couple of minutes. Just remember to test it in a development environment first.

Full details are available in our documentation.

Get the latest Platform.sh news and resources

Related Content

Meeting Jonny Harris: WordPress performance optimization with Blackfire

Meeting Jonny Harris: WordPress performance optimization with Blackfire

AboutSecurity and complianceTrust CenterCareersPressContact us
Thank you for subscribing!
Field required
Leader Winter 2023
System StatusPrivacyTerms of ServiceImpressumWCAG ComplianceAcceptable Use PolicyManage your cookie preferencesReport a security issue
© 2024 Platform.sh. All rights reserved.
Supported by Horizon 2020's SME Instrument - European Commission 🇪🇺