Score:1

How are compiled CSS and JavaScript files handled with S3?

br flag

I have my Drupal site set up to upload public files into the S3 bucket but am having some strange behavior with different environments and different s3 buckets. I have 3 s3 buckets: one for our production environment, one for our staging environment, and one for my development environment. The Drupal configurations are set up to point to their respective s3 bucket based on environment.

There's been a couple of instances now where our staging instance is working perfectly fine and it's s3 bucket has the compiled css and js files, and then after a random deployment from development (not every deployment though) the staging instance is failing to load a css resource because it doesn't exist in the respective S3 bucket because the css resource it's trying to load actually exists in the development environment's s3 bucket.

How does drupal handle loading these resources, like, where does it actually retrieve the filenames from? I'm just trying to figure out why it's trying to retrieve a filename for a resource that was generated in development instead of the filename for a resource that it generates?

P.S.

The deployments never contain any of thing in the codebase related to which files to load.

sonfd avatar
in flag
I'd be curious to know if you have a similar issue if aggregation is disabled. Also thin it'd be helpful to know how you're connecting Drupal to the S3 buckets as that seems like a probable fail point.
BlondeSwan avatar
br flag
Not sure where I'd check on the aggregation part, but I'm simply using the S3 File System Module to link to S3. It's suppose to store private and public files
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.