• Overview
    Frameworks
    • Drupal
    • WordPress
    • Symfony
    • Magento
    • See all frameworks
    Features
    • Observability
    • Auto-scaling
    Solutions
    • Marketing Teams
    • Retail
    • Higher Education
  • 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
  • Contact
  • Login
  • Free Trial
Blog
Thumbnail

Wildcard support for cookies in the HTTP cache

wordpressdrupal
October 17, 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...

https://{default}/:
    type: upstream
    upstream: app:http
    cache:
        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
Subscribe

Related Content

Cover image

Stop wasting your time! A modern development workflow for WordPress, using Platform.sh plus third-party tools

Company
AboutSecurity and complianceTrust CenterBoard and investorsCareersPressContact us
System StatusPrivacyTerms of ServiceImpressumWCAG ComplianceManage your cookie preferencesReport a security issue
© 2022 Platform.sh. All rights reserved.
Supported by Horizon 2020's SME Instrument - European Commission 🇪🇺